You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
256 B
Python

9 months ago
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)