In this tutorial, you will learn about the Python string isupper() method to check a string contains all uppercase characters or not.
In the previous tutorial, we have seen the Python string islower() method to check a string contains all lowercase characters or not.
Headings of Contents
Python String isupper() Method
Python string isupper()
function is a string built-in function that is used to return True or False. If the string contains all uppercase characters, it returns True otherwise it returns False.
Syntax:
The syntax of string isupper()
method.
string.isupper()
Parameter:
The String isupper() method does not accept any parameter.
Return Type:
isupper function in Python returns a Boolean value. True or False.
Let’s see an example for using the python isupper()
string method.
Python String isupper Example:
Here we will take some examples to understand the Python string isupper() method.
Example 1:
str = "python"
str2 = str.isupper()
print(str2)
The output will be:- False
Example 2:
str = "PROGRAMMING 12"
str2 = str.isupper()
print(str2)
The output will be:- True
Example 2:
str = "Programming"
str2 = str.isupper()
print(str2)
The output will be:- False
Conclusion:
In this tutorial, you have learned about the Python string isupper() method to check whether a string contains all uppercase characters or not. If all characters are in uppercase, will return True otherwise it will return False.
I hope this article will help you. if you like this article, please share it with your friends who want to learn Python programming.
- String endswith() method
- String casefold() method
- String center() method
- String capitalize() method
- String count() method
- String index() method
- String format() method
- String isalpha() method
For More Information:- Click Here