the below code had previously printed the fibonnacci using for loop at end. I moved the print inside the function and then called it but no fibonacci nubers were printed out in spite of the print within the function. Shouldnt they be?
def fibon(n):
a = b = 1
for i in range(n):
yield a
a, b = b, a + b
print(a) # move here inside function but doesnt print?
fibon(20)
old code works as:
for x in fibon(100):
print(x)