#!usr/bin/env python
# encoding:utf-8
'''
功能:斐波那契数列的实现,输入n,输出第n项的斐波那契数列
'''
def febonacci(n):
'''
输入:n
输出:Fibonacci数列的第n项
'''
f_list = [1, 1]
if n <= 0:
return 0
elif n == 1 or n == 2:
return 1
else:
for i in range(2, n):
f_list.append(f_list[i - 1] + f_list[i - 2])
return f_list[-1]
if __name__ == '__main__':
print(febonacci(5))