LearnPy Hub
← Recursion & Lambda problems
Medium

Count Digits Recursively

Write a recursive digits(n) that returns how many digits a non-negative integer has (0 has one digit), using //. Read n and print it.

Input

One integer.

Output

One integer.

Sample 1

Input
12345
Output
5

Sample 2

Input
0
Output
1
solution.py
Output appears here
Count Digits Recursively · Python practice problem · LearnPy Hub