Depth of recursion: Number of times a function is called recursively.
Example: Consider a program to compute the factorial of a number using a recursion. When given a large input, the program crashed and gives a "maximum recursion of depth exceeded error".
# A simple recursive function
# to compute the factorial of a number
if(n == 0):
return n * fact(n - 1)
if __name__ == '__main__':
# taking input
f = int(input('Enter the number: \n'))
You can check the recursion limit with sys.getrecursionlimitand change the recursion limit with sys.setrecursionlimitbut doing so is dangerous. The standard limit is a little conservative, but Python stackframes can be quite big.