p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px }
span.s1 { color: #0433ff }
span.s2 { color: #941100 }
def fn_1(n):
if n == 0 :
return n
elif n == 1 :
return n
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))
时间: 2024-11-15 09:21:08