.isupper()
Published Dec 22, 2021
Contribute to Docs
The .isupper()
string method takes in a string and returns True
if all the letters in the string are in uppercase, else returns False
. This method ignores spaces, newlines, numeric, and special characters in the string.
Syntax
string.isupper()
Example
Use .isupper()
to check if a string contains only uppercase letters:
my_string = "Python3"print(my_string.isupper())# Output: False
Codebyte Example
Use .isupper()
to check if my_string
contains only uppercase letters, ignoring the dashes:
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Python on Codecademy
- Skill path
Analyze Data with Python
Learn to analyze and visualize data using Python and statistics.Includes 8 CoursesWith CertificateIntermediate13 hours - Course
Learn Python 3
Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.With CertificateBeginner Friendly23 hours