Python String isupper() Method
By Lenin Mishra
If you prefer to watch Youtube videos over reading blogs, check out our video on Python strings here.
Python String isupper()
method
The isupper()
method in Python returns True
if all the characters are in upper case.
Only alphabet characters are taken into consideration. Numbers, symbols and spaces are not checked.
Syntax of isupper()
method
string.isupper()
Returns True or False
Example
s = "HELLO, I AM PYLENIN"
print(s.isupper())
>>> True
s = "123456"
print(s.isupper())
>>> False
s = "I AM 29 YEARS old"
print(s.isupper())
>>> False
Check out other commonly used Python string methods.
Related Articles
- How to create a string in Python?
- How to access characters in a Python string?
- How to replace characters in a string in Python?
- How to concatenate strings in Python?
- How to iterate through a string in Python?
- Check if a Substring is Present in a Given String in Python
- Escape sequences in Python String
- Python String Formatting - The Definitive Guide