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
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
EntrarTests12
Visible tests
Teste oculto 7
Teste oculto 8
Teste oculto 9
Teste oculto 10
Teste oculto 11
Teste oculto 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