📜  python代码示例中去除递归限制的解决方案

📅  最后修改于: 2022-03-11 14:45:50.296000             🧑  作者: Mango

代码示例1
pythonCopyimport sys
sys.setrecursionlimit(5000)
def fact(n):
    """Recursive function to find factorial"""
    if n == 1:
        return 1
    else:
        return (n * fact(n - 1))
    
print(fact(4000))