Python 3 - String isupper() Method


Description

The isupper() method checks whether all the case-based characters (letters) of the string are uppercase.

Syntax

Following is the syntax for isupper() method −

str.isupper()

Parameters

NA

Return Value

This method returns true if all cased characters in the string are uppercase and there is at least one cased character, false otherwise.

Example

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

#!/usr/bin/python3

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

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

Result

When we run above program, it produces the following result −

True
False
python_strings.htm
Advertisements