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

Python3 isupper() Method

Python3 isupper() Method

Python3 Strings Python3 Strings


Description

The 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 demonstrates the isupper() method:

Example

#!/usr/bin/python3

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

Python3 Strings Python3 Strings