标签:pytho pre highlight 斐波那契 div end range bsp 斐波那契数列
# 求斐波那契数列的第 n 项 def fibo(n): if n <=2: return 1 else: return fibo(n-1) + fibo(n-2) print(fibo(10))
# 写出斐波那契数列的前 n 项 def fibo(n): a ,b = 0 ,1 ret =[] for i in range(n): ret.append(b) a , b = b , a +b return ret print(fibo(10))
标签:pytho pre highlight 斐波那契 div end range bsp 斐波那契数列
原文地址:https://www.cnblogs.com/libragyf/p/12121582.html