![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Captain Kolor
Read more, think more, and do more
展开
-
Python实现阶乘函数的两种方法
1. 迭代(Iterative)迭代思想的核心:for循环语句 & range内置函数计算顺序:从小到大def factorial(number): product = 1 for i in range(number): product = product * (i+1) return product2. 递归(Recursive)递归思...原创 2018-12-08 21:01:43 · 18977 阅读 · 0 评论 -
Python实现斐波那契数列的两种方法
递归方法def fibonacci(n): terms = [0,1]原创 2019-02-13 09:38:10 · 345 阅读 · 0 评论