Thursday, March 8, 2018

String isupper() Method


String isupper() Method in Python 3


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

Syntax
str.isupper()

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

Example
#!/usr/bin/python3
str = "THIS IS STRING EXAMPLE....WOW!!!"
print (str.isupper())
str = "THIS is string example....wow!!!"
print (str.isupper())

Result
True
False