The isupper () method used to check uppercase letters in Python
This article mainly introduces the isupper () method used to check uppercase letters in Python. It is the basic knowledge in Python. For more information, see
The isupper () method checks whether all uppercase and lowercase characters (letters) of a string are in uppercase.
Syntax
The syntax of the isupper () method is as follows:
?
Parameters
NA
Return Value
If all characters in the string are uppercase letters and at least one case-sensitive character, true is returned. Otherwise, false is returned.
Example
The following example shows how to use the isupper () method.
?
1 2 3 4 5 6 7 |
#! /Usr/bin/python Str = "this is string example... WOW !!! "; Print str. isupper (); Str = "THIS is string example... wow !!! "; Print str. isupper (); |
When we run the above program, it will produce the following results:
?