Generator (computer programming): Difference between revisions

Content deleted Content added
Other Implementations: Added generators in C++
Generator Expressions: Square of 10 and higher is never less than 20
Line 88:
The following extends the example above by using a generator expression to compute squares from the countfrom generator function:
<source lang="python">
squares = ( n*n for n in countfrom(102) )
 
for j in squares: