def fib(limit):
a, b = 0, 1
while a < limit:
yield a
a, b = b, a + b
x = fib(100)
for value in x:
print(value, end=" ")
if you change the condition like below the outcome is not Fibonacci. Why?
def fib(limit):
a = 0
b = 1
while a < limit:
yield a
a = b
b = a + b
x = fib(100)
for value in x:
print(value, end=" ")