Strings and text · Python exercise
Read a sentence and convert it to title case with Python string methods.
Read one line of text and print it with the first letter of each word capitalized and the remaining letters lowercased.
Example 1
Input
hello world
Output
Hello World
Example 2
Input
python is fun
Output
Python Is Fun
How testing works
Your code runs once per test case with that case's standard input. Output is compared after normalising trailing spaces and blank lines at the end. Use input() without a prompt when the exercise expects clean output.
Loading editor…
Press Run tests to execute your code against every input case. Python runs in a Web Worker in your browser.