It is a method in python that returns all the first character of every word in upper case of a string. If a word contains any special character or number the following letter is converted to upper case.
s = “title is a method in python” x = s.title() print(x)
Title Is A Method In Python
Here the first letter of all the words are converted to upper case. Since there is has a space before all the word excluding the first word.
*Have a closer attention to the next example!
s = “title i!s a method in python” x = s.title() print(x)
Title I!S A Method In Python
Here the letter “S” is converted to upper case since the previous character is a special character (!) along with first character of all the words in the string.