Latest web development tutorials

Python isupper () method

Python strings Python strings


description

Python isupper () method to detect whether a string of all the letters are capitalized.

grammar

isupper () method syntax:

str.isupper()

parameter

  • no.

return value

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

Examples

The following example shows isupper () instance method:

#!/usr/bin/python

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

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

Examples of the above output results are as follows:

True
False

Python strings Python strings