Python string Method - isupper()

The isupper() method is a built-in string method in Python that returns True if all the alphabetic characters in the string are uppercase characters, and there is at least one alphabetic character in the string. Otherwise, it returns False.

Here is the syntax of the isupper() method:

str.isupper()
‮‬Source:www.theitroad.com

The isupper() method does not take any arguments. It can be called on a string and returns a Boolean value.

Example:

# Example 1
string1 = "THIS IS ALL UPPERCASE"
print(string1.isupper()) # Output: True

# Example 2
string2 = "This is not all UPPERCASE"
print(string2.isupper()) # Output: False

In the above example, string1 contains only uppercase alphabetic characters, so isupper() method returns True. string2 contains lowercase alphabetic characters, so isupper() method returns False.