python 实现斐波那契数列
2015-03-05 11:35
155 查看
def fib(n): a,b=0,1 while a<n: print(a,end=" ") a,b=b,a+b print() fib(2000)
输出:
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597
相关文章推荐
- python实现的斐波那契数列
- Python 实现斐波那契数列 (黄金分割数列)
- python 斐波那契数列缓存方式实现
- 斐波那契数列的算法实现 —— python
- python实现最简单斐波那契数列
- python超简单实现斐波那契数列
- 斐波那契数列(Fibonacci sequence)Python实现的三种方案:列表 递归 生成器
- python语言实现斐波那契数列
- Python中斐波那契数列实现
- python学习系列---斐波那契数列的多种实现
- python实现1、使用迭代器实现斐波那契数列;2、从迭代器得到序列
- python实现斐波那契数列的方法示例
- 算法:Python中的斐波那契数列实现
- python实现斐波那契数列
- 分别用的列表,递归,生成器三种方式创建出n个元素的斐波那契数列(Python3实现)
- python 实现斐波那契数列,动态删除历史数据demo,很久以前写的,分享给大家 推荐
- Python实现一个简易的斐波那契数列
- Python3基础 用 while循环实现 斐波那契数列
- 斐波那契数列的实现(Python)
- python学习系列---斐波那契数列的多种实现