Source Code:
(back to article)
def squares(): for i in range(1, 11): yield i ** 2 for square in squares(): print(square) # Output: # 1 # 4 # 9 # 16 # 25 # 36 # 49 # 64 # 81 # 100
Result:
Report an issue