Manual Lowercase
In this exercise, you will convert letters to lowercase yourself instead of relying on str.lower. Given a string word, replace every uppercase ASCII letter with its matching lowercase letter. Leave all other characters exactly as they are, and return the new string. Do not use str.lower.
Примеры
Ввод
"wow"Вывод
"wow"Ввод
"HellZo"Вывод
"hellzo"Ввод
"WHAT"Вывод
"what"Нужно реализовать
def lower(word: str) -> str:
Теги
strings
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit seVisible tests
1
Input
"wow"Expected
"wow"2
Input
"HellZo"Expected
"hellzo"3
Input
"WHAT"Expected
"what"4
Input
"wh[]32"Expected
"wh[]32"5
Input
"whAT"Expected
"what"6
Input
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Expected
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Focus radio
Paused · SomaFM · Fluid