Python String isupper() Method with Examples

Learn Python's isupper() method for strings. Explore Python's isupper() method with practical examples, ensuring accurate validation for uppercase characters in strings. Returns True if all characters in the string are upper case

Definition and Usage

The isupper() method returns True if all the characters are in upper case, otherwise False.

Numbers, symbols and spaces are not checked, only alphabet characters.

Example

Check if all the characters in the text are in upper case:

txt = "THIS IS NOW!"

x = txt.isupper()

print(x)

Syntax

string.isupper()

Parameter Values

No parameters.

More Examples

Example

Check if all the characters in the texts are in upper case:

a = "Hello World!"
b = "hello 123"
c = "MY NAME IS PETER"

print(a.isupper())
print(b.isupper())
print(c.isupper())

#python

Python String isupper() Method with Examples
1.05 GEEK