代码如下:
def getfibonacci(num): res=[0,1] a=0 b=1 for x in range(0,num): if x==a+b: res.append(x) a,b=b,a+b return res
res=getfibonacci(1000)print(res)
#递归a=[0,1]qian=0def fibna(num,qian): print(num) he=num+qian if he
A programmer’s note boke for work and life
代码如下:
def getfibonacci(num): res=[0,1] a=0 b=1 for x in range(0,num): if x==a+b: res.append(x) a,b=b,a+b return res
res=getfibonacci(1000)print(res)
#递归a=[0,1]qian=0def fibna(num,qian): print(num) he=num+qian if he