Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python istitle() method

Python istitle() method

Python Strings Python Strings


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

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 Python Strings