def f(max): n, a, b = 0, 0, 1 while n <= max: yield b a, b = b, a + b n += 1 yield 'done' for i in f(5): print(i)
def f(max): n, a, b = 0, 0, 1 while n <= max: yield b a, b = b, a + b n += 1 yield 'done' for i in f(5): print(i)
转载于:https://www.cnblogs.com/xusuns/p/8477639.html