Python3 isupper() Method

Python3 字符串Python3 Strings


Description

The isupper() method checks whether all letters in the string are uppercase.

Syntax

isupper() method syntax:

str.isupper()

Parameters

  • None.

Return Value

If the string contains at least one case-sensitive character, and all these (case-sensitive) characters are uppercase, it returns True, otherwise it returns False.

Example

The following example demonstrates the usage of the isupper() method:

Example

#!/usr/bin/python3

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

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

The output of the above example is:

True
False

Python3 字符串Python3 Strings

Other Extensions