Python istitle() method
Description
The Python istitle() method checks whether all words in a string have their first letter capitalized and all other letters lowercase.
Syntax
Syntax of the istitle() method:
str.istitle()
Parameters
- none.
Return Value
Returns True if all words in the string begin with an uppercase letter and all other letters are lowercase, otherwise False.
Example
The following example demonstrates the istitle() method:
#!/usr/bin/python
str = "This Is String Example...Wow!!!";
print str.istitle();
str = "This is string example....wow!!!";
print str.istitle();
The output of the above example is:
True
False
Python Strings