How Many Digits
Counting digits is useful when you need to check the length of a code, order number, or numeric ID. The function count_digits receives a non-negative integer n and returns how many digits it contains. The number 0 counts as one digit.
Примеры
Ввод
0Вывод
1Ввод
7Вывод
1Ввод
12345Вывод
5Нужно реализовать
def count_digits(n: int) -> int:
Теги
math
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηVisible tests
1
Input
0Expected
12
Input
7Expected
13
Input
12345Expected
54
Input
100Expected
35
Input
99Expected
26
Input
999999Expected
6Focus radio
Paused · SomaFM · Fluid