Make It CamelCase
In code, names are often written by joining words together and capitalizing the start of each word. Write camel_case, which takes a string s, capitalizes the first letter of every word, and removes the spaces between them. The words in the original string are separated by single spaces.
Примеры
Ввод
"test case"Вывод
"TestCase"Ввод
"camel case method"Вывод
"CamelCaseMethod"Ввод
"say hello"Вывод
"SayHello"Нужно реализовать
def camel_case(s: str) -> str:
Теги
strings
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänVisible tests
1
Input
"test case"Expected
"TestCase"2
Input
"camel case method"Expected
"CamelCaseMethod"3
Input
"say hello"Expected
"SayHello"4
Input
""Expected
""5
Input
"hello"Expected
"Hello"6
Input
"test casetest case"Expected
"TestCasetestCase"Focus radio
Paused · SomaFM · Fluid