String Length
String length is useful all the time: checking a password, trimming text, or showing a character counter in a form. Write a function string_length that takes a string s and returns how many characters it contains. An empty string has length 0.
Примеры
Ввод
"hello"Вывод
5Ввод
""Вывод
0Ввод
"a"Вывод
1Нужно реализовать
def string_length(s: str) -> int:
Теги
strings
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
AccediVisible tests
1
Input
"hello"Expected
52
Input
""Expected
03
Input
"a"Expected
14
Input
"Rosetta Code"Expected
125
Input
" "Expected
36
Input
"12345678"Expected
8Focus radio
Paused · SomaFM · Fluid