# in-class work
# Define a generator, that will be generating Fibonacci numbers.
# Generator of Fibonacci sequence numbers,
# 0, 1, 1, 2, 3, 5, 8, ...
## Second version
## Which one do you like better?
def Fibonacci():
yield 0
yield 1
curr = 1
prev = 0
while True:
yield curr + prev
tmp = curr
curr += prev
prev = tmp
a = Fibonacci()
for i in range(20):
print(next(a))