A generator function: creates its objects on the fly. : Generator Function « Buildin Function « Python






A generator function: creates its objects on the fly.

A generator function: creates its objects on the fly.


def iterquad ():
     for i in range(5):
         yield (i*i)
 
for j in iterquad():
     print j


           
       








Related examples in the same category

1.Generators Generators
2.Generator ExpressionsGenerator Expressions