def fn_1(n):
if n == 0 :
return n
elif n == 1 :
else:
a = [0,1]
for i in range(2,n):
a.append(a[i-1] + a[i-2])
print (a[i])
print (fn_1(10))
斐波那契 - pythoon实现
原文:http://www.cnblogs.com/gforc/p/7384708.html