def get_num(max):
a,b,c=0,0,1
while a<max:
print(c)
b,c=c,b+c
a=a+1
return '``````````````'
if __name__=='__main__':
get_num(5))
结果
1
1
2
3
5
def get_num(max):
a,b,c=0,0,1
while a<max:
print(c)
b,c=c,b+c
a=a+1
return '``````````````'
if __name__=='__main__':
get_num(5))
结果
1
1
2
3
5