LearnPy Hub
← Loops problems
Medium

Count Digits with a Loop

Read a positive integer and count its digits using a while loop that divides by 10.

Input

One integer n ≥ 1.

Output

Digit count.

Sample 1

Input
12345
Output
5

Sample 2

Input
7
Output
1
solution.py
Output appears here
Count Digits with a Loop · Python practice problem · LearnPy Hub