# in-class work
# Define a generator, that will be generating Fibonacci numbers.
# Generator of Fibonacci sequence numbers,
# 0, 1, 1, 2, 3, 5, 8, ...
def Fibonacci():
preprev = 0
prev = 1
callN=0
while True:
if callN == 0: # the fist number in sequence case
yield preprev
elif callN == 1: # the second number in sequence case
yield prev
else:
t = preprev + prev
yield t
preprev = prev
prev = t
callN += 1
seq = Fibonacci()
for i in range(20):
print(next(seq))