THE WORLD'S LARGEST WEB DEVELOPER SITE

Python String isupper() Method

❮ String Methods


Example

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

txt = "THIS IS NOW!"

x = txt.isupper()

print(x)
Run example »

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.


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())
Run example »

❮ String Methods