Capitalize Words
Given a string s where words are separated by single spaces, capitalize the first letter of each word. Leave all other characters exactly as they are. This is like simple formatting for titles, names, or labels in text. Return the updated string.
Примеры
Ввод
"hello world"Вывод
"Hello World"Ввод
"the quick brown FOX"Вывод
"The Quick Brown FOX"Ввод
"a b c"Вывод
"A B C"Нужно реализовать
def capitalize_words(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