Python String isupper() Method
The isupper()
method checks whether all alphabetic characters in a string are uppercase.
Syntax
string.isupper()
Parameter
No parameter.
Return Value
Returns True
if all alphabetic characters in a string are uppercase and there is at least one alphabetic character. It only checks alphabetic characters (A-Z) and ignores non-alphabetic characters, such as numbers, symbols, and whitespace.
Returns False
otherwise (includes empty string and string with no alphabetic character).
Examples
Check if a String is Uppercase
print("HELLO".isupper()) # True
print("Hello".isupper()) # False
print("HELLO123".isupper()) # True
print("HELLO@".isupper()) # True
print("123".isupper()) # False (no alphabetic character)
print("".isupper()) # False (empty string)