标签:
100 以内的斐波那契数列
1 a, b = 0, 1 2 3 while b < 100: 4 print b 5 a, b = b, a + b
任意上界的斐波那契数列函数
1 def fib(n): 2 a, b = 0, 1 3 result = [] 4 while a < n: 5 result.append(a) 6 a, b = b, a + b 7 8 return result
标签:
原文地址:http://www.cnblogs.com/sdmfw/p/5686496.html