Python String title() Method

By Lenin Mishra

If you prefer to watch Youtube videos over reading blogs, check out our video on Python strings here.

Python String title() method

The title() method in Python returns a string where the first character of every word is uppercase.

If the word contains a number or a symbol, the first letter after the symbol/number will be converted to uppercase.

Syntax of title() method

Returns a new string


x = "pylenin loves python"
>>> Pylenin Loves Python

x = "My Instagram handle is - @pylenin"
>>> My Instagram Handle Is - @Pylenin

x = "Check alphanumeric values - 123abc"
>>> Check Alphanumeric Values - 123Abc

Check out other commonly used Python string methods.

  1. How to create a string in Python?
  2. How to access characters in a Python string?
  3. How to replace characters in a string in Python?
  4. How to concatenate strings in Python?
  5. How to iterate through a string in Python?
  6. Check if a Substring is Present in a Given String in Python
  7. Escape sequences in Python String
  8. Python String Formatting - The Definitive Guide