The method isupper() checks whether all the case-based characters (letters) of the string are uppercase.
The syntax of the method is: str.isupper()
Key Points :
• There are no islower() function parameters.
• If a string has in the uppercase letters, the method returns true and returns false otherwise.
• This method returns true for whitespace if alphabets and uppercase are the other characters in the provided string. This method returns false for a string of only whitespaces.
Below is the python program to demonstrate the isupper() function:
str = "THE BEST LEARNING RESOURCE FOR ONLINE EDUCATION"; print (str.isupper()) str = "The Best Learning Resource for ONLINE EDUCATION"; print (str.isupper())
When we run above the program, the outcome is as follows:
True
False
Below are several other functions that we can use to work with string in Python 3