Write a programExercise 3/4Elementary20 XP

Counting digits without text

Task

The program reads a non-negative whole number and prints how many digits it has. Solve it with a while loop and integer division - do not use the len or str functions.

Careful: the number 0 has one digit too.

Examples

  • Input

    12345

    Expected output

    5

Rules

  • Count the digits by dividing - no len or str.

After you submit, 7 hidden tests will also check your solution: zero, a one-digit number, 10, 99, 100, a million, a ten-digit number.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.