Loading...
Loading...
Loading...
A ticket system prints each ticket number on a fixed-width label, so it must know how many digits the number has. Given a ticket number n, print its number of digits. The number 0 has 1 digit.
Example
Input
90210
Output
5
Five digits.
Try the problem first. Open one hint at a time.
Remove the last digit with // 10 and count how many times you can do that.
Handle 0 on its own: the loop does not run for it.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor