Character Mix
Sometimes you need a quick breakdown of what a string contains: letters, digits, and everything else. The function count_char_types receives a string s and returns a list of three numbers. The first number is the count of letters, the second is the count of digits, and the third is the count of all other characters.
Примеры
Ввод
"abc123!!"Вывод
[3, 3, 2]Ввод
""Вывод
[0, 0, 0]Ввод
"hello"Вывод
[5, 0, 0]Нужно реализовать
def count_char_types(s: str) -> list[int]:
Теги
stringsdict
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
BejelentkezésTests12
Visible tests
Rejtett teszt 7
Rejtett teszt 8
Rejtett teszt 9
Rejtett teszt 10
Rejtett teszt 11
Rejtett teszt 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid