Fibonacci数列:除第一个与第二个数之外,其余数均由前两个数相加得到: 1, 1, 2, 3, 5, 8, 13, 21, 34, ... 通过生成器,程序如下: def fib(max): m, a, b = 0, 0, 1 while m < max: yield b a, b = b ,a+b m = m+1 return 'done' 要将其结果打印出来: g = fib(6) while True: try: x = next(g) print('g:', x) except S…