- /usr/bin/python
- def func(x):
- if x==0 or x==1:
- return 1
- else:
- first=1
- second=1
- for i in range(x-2):
- value=first+second
- first=second
- second=value
- return first+second
- #该片段来自于http://www.codesnippet.cn/detail/0202201614517.html
来源: http://www.codesnippet.cn/detail/0202201614517.html