def fib(max):
n, a, b = 0, 0, 1
while n < max:
yield b
a, b = b, a + b
n = n + 1
return 'done'
if __name__=='__main__':
for a in fib(6):
print(a)
def fib(max):
n, a, b = 0, 0, 1
while n < max:
yield b
a, b = b, a + b
n = n + 1
return 'done'
if __name__=='__main__':
for a in fib(6):
print(a)
本文标题:test代码
本文链接:https://www.haomeiwen.com/subject/nwwcuhtx.html
网友评论