try:
def iwillcall():
def repeat_me():
print('hello world')
print(iwillcall())
print(repeat_me())
iwillcall()
except RecursionError:
print('you reached the limit')
result :
hello world
hello world
hello world
hello world
hello world
hello world
hello world
you reached the limit
How can i count how many times recursion printed 'hello world ' ?