Python String isupper() Methods


Contents

Description

The isupper() method in Python String checks whether the given string has at least one character and if all the case-based characters (letters) are uppercase of the string. If it happens to be in Uppercase, then the Python isupper function is responsible for returning True else it would return False

Syntax

Here is the syntax for isupper() method:

str.isupper()

Parameters

  • NA

Return Value

This method returns true when all the cased characters within the string are uppercase and there exists at least one cased character, otherwise, it would return false.

Example

The example below shows the usage of isupper() method.

#!/usr/bin/python

str = "THIS IS STRING EXAMPLE....WOW!!!"; 
print str.isupper()

str = "THIS is string example....wow!!!";
print str.isupper()

When the above program is run, it produces the following result:

True
False

Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.



Navigation
Tutorial
Tutorial
Tutorial