Python String isupper() Method

Determines whether string contains uppercase characters

Usage

The isupper() method return TRUE if all cased characters in the string are uppercase and there is at least one cased character, false otherwise.

Syntax

string.isupper()

Examples

Example: Check if all characters in the string are uppercase

S = 'ABCD'
x = S.isupper()
print(x)	# True

The method returns FALSE, if the string doesn’t contain at least one cased character.

Example:

S = '123$@%'
x = S.isupper()
print(x)    # False
S = 'A123$@%'
x = S.isupper()
print(x)    # True

The method also returns FALSE, if the string contains at least one lowercase alphabet.

Example:

S = 'ABCDe'
x = S.isupper()
print(x)    # False