python实现递归 不多赘述:递归就是自己调用自己,有一个基线条件用于结束递归 案例:阶乘 # encoding=utf-8 def f(n): if n <=2: return n return f(n-1)*n print(f(10))