Learn Python's isupper() method for strings. Explore Python's isupper() method with practical examples, ensuring accurate validation for uppercase characters in strings. Returns True if all characters in the string are upper case
The isupper()
method returns True if all the characters are in upper case, otherwise False.
Numbers, symbols and spaces are not checked, only alphabet characters.
Check if all the characters in the text are in upper case:
txt = "THIS IS NOW!"
x = txt.isupper()
print(x)
string.isupper()
No parameters.
Check if all the characters in the texts are in upper case:
a = "Hello World!"
b = "hello 123"
c = "MY NAME IS PETER"
print(a.isupper())
print(b.isupper())
print(c.isupper())
#python