Last active
August 8, 2016 07:39
-
-
Save brainyfarm/d62ed6b1a121a3500d3e63ccfd4b2e53 to your computer and use it in GitHub Desktop.
FreeCodeCamp: Title Case a Sentence (Python)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Return the provided string with the first letter of each word capitalized. | |
Make sure the rest of the word is in lower case. | |
For the purpose of this exercise, you should also capitalize connecting words like "the" and "of". | |
""" | |
def title_case(sentence): | |
# Pretty Straight Forward ;) | |
return sentence.title() | |
print title_case("This is so sweet") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment