.isupper()

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:

Code
Output
Loading...

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn Python on Codecademy