当你的程序递归的次数超过999次的时候,就会引发RuntimeError: maximum recursion depth exceeded.
解决方法两个:
1、增加系统的递归调用的次数:
import sys
sys.setrecursionlimit(n) n为你想要的递归上限
2、优化代码,减少递归的次数。
原文地址:https://www.cnblogs.com/everfight/p/maximum_recursion.html
时间: 2024-08-06 10:41:26