28.10.2021 Views

Python Tutorial ( PDFDrive )

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

str = "This is string example....wow!!!";

print str.isspace();

Let us compile and run the above program, this will produce the following result:

True

False

istitle()

Description

The method istitle() checks whether all the case-based characters in the string following non-casebased letters

are uppercase and all other case-based characters are lowercase.

Syntax

Following is the syntax for istitle() method:

str.istitle()

Parameters

• NA

Return Value

This method returns true if the string is a titlecased string and there is at least one character, for example

uppercase characters may only follow uncased characters and lowercase characters only cased ones. It returns

false otherwise.

Example

The following example shows the usage of istitle() method.

#!/usr/bin/python

str = "This Is String Example...Wow!!!";

print str.istitle();

str = "This is string example....wow!!!";

print str.istitle();

Let us compile and run the above program, this will produce the following result:

True

False

isupper()

Description

The method isupper() checks whether all the case-based characters (letters) of the string are uppercase.

TUTORIALS POINT

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!