Python Capitalize Word

August 21, 2018
"hello world".title()
# Output = Hello World

title doesn’t work well with apostrophes(‘). In such cases, use string.capwords instead.

import string
string.capwords("jack's world, pets' world")
# Output = Jack's World, Pets' World
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.