title() String Method in Python with Examples

title() method converts all first letter in words of string to uppercase.

Example: title() String Method


message = 'welcome to python 123!'
print(message.title())

# OR

message = 'welcome to python 123!'
print(str.title(message))

Output

Welcome To Python 123!


Related String Methods