ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] 参考链接:https://www.shangyexinzhi.com/article/363884.html ## 递归图文解释 ![](https://img.shangyexinzhi.com/xztest-image/article/a9ad0b2e7fc4b214d79773088bf5c95c.jpeg?x-oss-process=image/resize,w_670) ``` def func(n): print "递:%d "%n, if n==1: res = 1 else: res = n*func(n-1) print "归:%d "%res, return res func(4) ``` 结果: ![](https://img-blog.csdnimg.cn/20200323140459806.png)