Because the law Feibolaqi series (1,1,2,3,5 ...) began to show the third number, it is necessary to store the incoming two variables
##计算斐波拉契数列
def fibla():
yield 1
yield 1
f1, f2 = 1, 1
while True:
f1, f2 = f2, f1+f2
yield f2
gen_fib = fibla()
for i in range(20):
print(next(gen_fib))