Defining generator functions with the yield statement