Artturi Jalli

I'm an entrepreneur and a blogger from Finland. My goal is to make coding and tech easier for you with comprehensive guides and reviews.

What Is the Maximum Recursion Depth in Python

The maximum recursion depth in Python is 1000. You can verify this by calling sys.getrecursionlimit() function: You can change the limit by calling sys.setrecursionlimit() method. For example: Consider this a dangerous action! If possible, instead of tweaking the recursion limit, try to implement your algorithm iteratively to avoid deep recursion. Python Maximum Recursion Depth Exceded

What Is the Maximum Recursion Depth in Python Read More »