Definition

An expression that returns an iterator. It looks like a normal expression followed by a for clause defining a loop variable, range, and an optional if clause. The combined expression generates values for an enclosing function:

>>>
>>> sum(i*i for i in range(10))         # sum of squares 0, 1, 4, ... 81
285