7 lines
146 B
Python
7 lines
146 B
Python
# gen.yield.from.py
|
|
def print_squares(start, end):
|
|
yield from (n ** 2 for n in range(start, end))
|
|
|
|
for n in print_squares(2, 5):
|
|
print(n)
|