Python String Title method

Title function in python is the Python String Method which is used to convert the first character in each word to Uppercase and remaining characters to Lowercase in string and returns new string.

Syntax:

str.Title()
parameters:str is a valid string which we need to convert.
return: This function returns a string which 
has first letter in each word is uppercase and all 
remaining letters are lowercase. 
filter_none

edit
close

play_arrow

link
brightness_4
code

# Python Title() Method Example
   
str1 = 'geeKs foR geEks'
str2 = str1.title()
print 'First Output after Title() method is = ', str2
  
# observe the original string
print 'Converted String is = ', str1.title()
print 'Original String is = ', str1
   
# Performing title() function directly
str3 = 'ASIPU pawan kuMAr'.title()
print 'Second Output after Title() method is = ', str3
   
str4 = 'stutya kUMari sHAW'.title()
print 'Third Output after Title() method is = ', str4
   
str5 = '6041'.title()
print 'Fourth Output after Title() method is = ', str5

chevron_right


Output:

First Output after Title() method is =  Geeks For Geeks
Converted String is =  Geeks For Geeks
Original String is =  geeKs foR geEks
Second Output after Title() method is =  Asipu Pawan Kumar
Third Output after Title() method is =  Stutya Kumari Shaw
Fourth Output after Title() method is =  6041


My Personal Notes arrow_drop_up

pawanasipugmailcom

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.