函数递归

#__author__:Administrator}
#a: 2017/11/
# def jie(n):
# if n==1:
# return 1
# return n*jie(n-1)
#
# print(jie(5))


#飞播那期数列:0,1,1,2,3,5,8,13,21
def fibo(n):
befo = 0
after = 1
for i in range(n-2):
sum = after+befo
befo = after
after = sum
return sum

print(fibo(5))
posted @ 2017-11-16 17:24  无敌帅帅头  阅读(75)  评论(0编辑  收藏  举报