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

Python isupper() method

Python isupper() method

Python Strings Python Strings


Description

The Python isupper() method checks whether all letters in a string are uppercase.

Syntax

Syntax of the isupper() method:


str.isupper()

Parameters

Return Value

Returns True if the string contains at least one cased character and all such cased characters are uppercase, otherwise False

Example

The following example shows how to use the isupper() method:

Example

#!/usr/bin/python

str

=

"THIS IS STRING EXAMPLE....WOW!!!"

;

print

(

str

.

isupper

(

)

)

;

str

=

"THIS is string example....wow!!!"

;

print

(

str

.

isupper

(

)

)

;

The output of the above example is:


True
False

Python Strings Python Strings