I'm trying to return the count of digits in a number using recursion like this: DigitCount(3456) → 4. The code that I have without using recursion works fine, which is:
def DigitCount(n)
return len(str(n))
But when I try using recursion in this way:
def DigitCount(n):
return len(str(DigitCount(n)))
I get an error message saying 'RecursionError: maximum recursion depth exceeded'