Python String istitle() Method is a built-in string function that returns True if all the words in the string are title cased, otherwise returns False.
Python String istitle() Method Syntax
Syntax: string.istitle()
Returns: True if the string is a title-cased string otherwise returns False.
Python String istitle() Method Example
Python3
string = "Geeks"print(string.istitle()) |
Output:
True
What is a title case?
When all words in a string begin with uppercase letters and the remaining characters are lowercase letters, the string is called title-cased. This function ignores digits and special characters.
Example 1:
More Examples on Python String istitle() Method
Python3
# First character in each word is# uppercase and remaining lowercases = 'Geeks For Geeks'print(s.istitle())# First character in first# word is lowercases = 'geeks For Geeks'print(s.istitle())# Third word has uppercase# characters at middles = 'Geeks For GEEKs'print(s.istitle())# Ignore the digit 6041, hence returns Trues = '6041 Is My Number'print(s.istitle())# word has uppercase# characters at middles = 'GEEKS'print(s.istitle()) |
Output:
True False False True False
Example 2: Condition Checking using istitle() method
Checking if a string is title cased using Python String istitle() Method.
Python3
s = 'I Love Geeks For Geeks'if s.istitle() == True: print('Titlecased String')else: print('Not a Titlecased String')s = 'I Love geeks for geeks'if s.istitle() == True: print('Titlecased String')else: print('Not a Titlecased String') |
Output:
Titlecased String Not a Titlecased String
Share your thoughts in the comments

