Menu Close

Python String isupper() Method

python string isupper

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.

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 return Boolean value. True or False.

Let’s see an example for using python isupper() string method.

Python String isupper Example:

Here we will take some examples to understand Python string isupper() method.

Example 1:

str = "python"
str2 = str.isupper()
print(str2)

Output will be:- False

Example 2:

str = "PROGRAMMING 12"
str2 = str.isupper()
print(str2)

Output will be:- True

Example 2:

str = "Programming"
str2 = str.isupper()
print(str2)

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 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.

For More Information:- Click Here

Previous Article
Next Article

Was this post helpful?

Related Posts

Leave a Reply