Clean Title Text
This kind of transformation is useful for names, headings, and titles that users typed with mixed casing. Write a function title_case that receives a string s where words are separated by spaces. Make the first letter of each word uppercase and the remaining letters of that word lowercase. Keep the word order and the spaces between words unchanged.
Примеры
Ввод
"hello world"Вывод
"Hello World"Ввод
"the QUICK brown"Вывод
"The Quick Brown"Ввод
"python"Вывод
"Python"Нужно реализовать
def title_case(s: str) -> str:
Теги
strings
Prisijunkite, kad matytumėte pateikimų istoriją
PrisijungtiPrisijunkite, kad naudotumėte DI mentorių
PrisijungtiTests12
Visible tests
Paslėptas testas 7
Paslėptas testas 8
Paslėptas testas 9
Paslėptas testas 10
Paslėptas testas 11
Paslėptas testas 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