CapWords Python

# imports string module
import string
sentence = 'Python is one of the best programming languages.'
# sep parameter is left None
formatted = string.capwords(sentence, sep = None)
print(formatted)
# Output: Python Is One Of The Best Programming Languages.


# imports string module
import string 
sentence = 'Python is one of the best programming languages.'
# sep parameter is 'g'
formatted = string.capwords(sentence, sep = 'g')
print('When sep = "g"', formatted)
# sep parameter is 'o'
formatted = string.capwords(sentence, sep = 'o')
print('When sep = "o"', formatted)
# Output: When sep = "g" Python is one of the best progRamming langUagEs.
# 		  When sep = "o" PythoN is oNe oF the best proGramming languages.
Witty Wombat