L = [x * x for x in range(10)] print(L) g = (x * x for x in range(10)) for i in range(0, 10): print(next(g)) def fib(max): n, a, b = 0, 0, 1 while n < max: yield b a, b = b, a + b n = n + 1 return 'done' fib(10)