Letter Case Count
Sometimes you need to quickly check what a text is made of, such as how many uppercase and lowercase letters it contains. Write a function upper_lower_count that takes a string s and returns a list of two numbers. The first number is the count of uppercase letters, and the second is the count of lowercase letters. Spaces, digits, and punctuation should not be counted.
Примеры
Ввод
"Hello World"Вывод
[2, 8]Ввод
"ABC"Вывод
[3, 0]Ввод
"abc"Вывод
[0, 3]Нужно реализовать
def upper_lower_count(s: str) -> list[int]:
Теги
strings
Prihláste sa, aby ste videli históriu odoslaní
Prihlásiť saPrihláste sa, aby ste mohli používať AI mentora
Prihlásiť saVisible tests
1
Input
"Hello World"Expected
[2,8]2
Input
"ABC"Expected
[3,0]3
Input
"abc"Expected
[0,3]4
Input
"123"Expected
[0,0]5
Input
"PyThOn"Expected
[3,3]6
Input
"hello world"Expected
[0,10]Focus radio
Paused · SomaFM · Fluid