CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day07/fibonacci.py
Views: 729
1
"""
2
生成斐波拉切数列
3
4
Version: 0.1
5
Author: 骆昊
6
Date: 2018-03-06
7
"""
8
9
10
def main():
11
f = [1 , 1]
12
for i in range(2, 20):
13
f += [f[i - 1] + f[i - 2]]
14
# f.append(f[i - 1] + f[i - 2])
15
for val in f:
16
print(val, end=' ')
17
18
19
if __name__ == '__main__':
20
main()
21
22