protel教程,被偷听的女人,军事历史小说
def f(n): second = 1 result = 1 while (n>2): n-=1 first = second second = result result = second +first print result return result
[f(i) for i in range(16)]
out[15]: [1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]
1 1 1 2 3 5 8
first second result
first second result (n>2)
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
新手学习Python2和Python3中print不同的用法
Python基于os.environ从windows获取环境变量
网友评论