Skip to content
C

Title Case Without .title()

Mediumpython

Capitalize the first letter of every word in a sentence, without using the built-in .title() method.

Approach: split the sentence into words, capitalize each word manually (word[0].upper() + word[1:].lower()), and join them back together with spaces.

Input: One line: a sentence.

Output: One line: the same sentence with the first letter of every word capitalized.

Input (stdin)

Output

Run your code to see output here...