1. What Is the istitle() Function in Python? (Definition)
The istitle() method is a built-in Python string function used to check whether a given string follows title case formatting. A string is considered title case when each word starts with an uppercase letter, followed by zero or more lowercase letters.
In simple terms, this method helps determine whether a text looks like a proper heading, title, name, or any phrase that follows correct capitalization rules. If the string meets the title-case format, istitle() returns True. Otherwise, it returns False.
This method becomes especially useful when cleaning text data, validating user input, formatting titles, or checking if names and headings are correctly capitalized.
2. Syntax of the istitle() Method
Below is the synax of istitle() Method:
string.istitle()
This is a simple, parameterless method that returns a Boolean value based on capitalization rules.
3. Parameter Description of the istitle() Method
| Parameter | Type | Description |
|---|---|---|
| None | N/A | The The istitle() method does not accept any parameters. method does not accept any parameters. |
Return Value
The method returns a Boolean value based on the capitalization of the string:
- Returns True → If every word in the string starts with an uppercase letter followed by lowercase letters.
- Returns False → If any word breaks the title-case rule (e.g., starts with a lowercase letter or contains mixed-case patterns).
- Returns False → If the string is empty.