# 斐波那契
def fib(m):
n, a, b = 1, 0, 1
while n <= m:
print(b)
a,b = b,a+b
n = n +1
fib(10)
结果:
1
1
2
3
5
8
13
21
34
55
python学习1-斐波那契数列
猜你喜欢
转载自blog.csdn.net/kaaosidao/article/details/79926696
今日推荐
周排行