📅  最后修改于: 2022-03-11 14:45:09.202000             🧑  作者: Mango
def fib(num):
a = 0
b = 1
for i in range(num):
yield a
a, b = b, a + b # Adds values together then swaps them
for x in fib(100):
print(x)