-
-
Save Jhonyrod/e4ef44b586e367695c8c8da7f6bc3377 to your computer and use it in GitHub Desktop.
This file contains 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
def cap(str): | |
return str[0].upper() + str[1:] | |
def title_case(title, minor_words = ''): | |
return cap(' '.join(list(map(lambda x: x.lower() if x.casefold() in minor_words.casefold().split() else x.capitalize(), title.split())))) if title else title |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment