-
-
Save Jhonyrod/fb0f8c844d01a833b3a802bbef248071 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 minor_words.casefold().count(x.casefold()) else cap(x.lower()), title.split())))) if title else title |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment