title() - This will capitalize the first letter of each word of a string
capitalize() - This will capitalize th first letter of the string
Example
This script performs the title and capitalize functions to each string in the list.
strings = ["let the music play", "i'm not dancing", "just listening"] for string in strings: print(string) print(string.title()) print(string.capitalize())
let the music play Let The Music Play Let the music play i'm not dancing I'M Not Dancing I'm not dancing just listening Just Listening Just listening