Skip to content

Eternal Center

  • System (系统)
  • Services (服务)
  • Databases (数据库)
  • Clusters (集群)
  • Big Data (大数据)
  • Cloud Computing (云计算)
  • Languages (语言)
  • Project (项目)
  • Writings (写作)
  • Eternity (永恒)
  • News (消息)
  • Chronicle (编年史)
  • Words (言)
Posted on May 2, 2020December 26, 2021 by Mingyu Zhu

[工具] Python 计算斐波那契数列

介绍:

使用方法:
1. 给此脚本添加执行权限
2. 执行此脚本

脚本:

#!/usr/bin/python3

print('Fibonacci sequence will be calculated')
num=input('Please make sure to calculate the number of months? ')

fb=[0,1]
month=int(num)

for i in range(1,month-2):
    new=fb[-1]+fb[-2]
    fb.append(new)
print(fb)
CategoriesChinese (中文), Languages (语言), Python, Python Science (科学)

Post navigation

Previous PostPrevious [内容] Python 字符串的拼接 (转载)
Next PostNext [工具] Python 统计文件中 IP 地址出现的次数

Aspiration (愿景):

Everyone can achieve self achievement and self happiness fairly

每个人都能公平地实现自我成就和自我幸福

Position (位置):

Running on Evolution Host and DigitalOcean

正在 Evolution Host 和 DigitalOcean 上运行

Logo (徽标):

Additional Information (其他信息):

About Manual Clone Contact Disclaimer Donation Friendly Links 关于 说明书 克隆 联系 免责申明 捐赠 友情链接

Standby IP Address (备用 IP 地址):

152.69.204.95  150.230.63.10  Please configure before use / 请先配置再使用

Search Outside Website (站外搜索):

Google Wikipedia Bing
Proudly powered by LNMP Proudly powered by WordPress