Python Function Reference

str.isupper

Check that all letters of the string are uppercase.

Python 3.13
str.isupper()

Return value

True or False; False for a string without letters.

Examples

Uppercase letters only

Python 3.13
print('HELLO'.isupper())
True

Digits and punctuation do not matter

Python 3.13
print('HELLO 2024!'.isupper(), '2024'.isupper())
True False

Details

Characters without case, such as digits, spaces and punctuation, do not affect the check, but there must be at least one letter: "2024".isupper() gives False.

See also