Digit Count

Given a non-negative integer n, count how many digits it has. Pay attention to the special case: the number 0 still has one digit. Return the digit count.

Примеры

Ввод
12345
Вывод
5
Ввод
0
Вывод
1
Ввод
7
Вывод
1

Нужно реализовать

def count_digits(n: int) -> int:

Теги

math
PostgreSQLv16

Tukaj bo rezultat izvajanja kode

Visible tests
1
Input
12345
Expected5
2
Input
0
Expected1
3
Input
7
Expected1
4
Input
24690
Expected5
5
Input
999999
Expected6
6
Input
1
Expected1
Focus radio
Paused · SomaFM · Fluid