educative.io

Educative

Error with numbers grater than 997

Hi, with numbers grater than 997 the Function throws errors, why!?

def rec_count(number):
print(number)
# Base case
if number == 0:
    return 0
rec_count(number - 1)  # A recursive call with a different argument
print(number)
rec_count(998)

Traceback (most recent call last):
File “main.py”, line 10, in
rec_count(998)
File “main.py”, line 6, in rec_count
rec_count(number - 1) # A recursive call with a different argument
File “main.py”, line 6, in rec_count
rec_count(number - 1) # A recursive call with a different argument
File “main.py”, line 6, in rec_count
rec_count(number - 1) # A recursive call with a different argument
File “main.py”, line 6, in rec_count
rec_count(number - 1) # A recursive call with a different argument
File “main.py”, line 6, in rec_count