A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/python-string-isupper-method/ below:

Python String isupper() method - GeeksforGeeks

Python String isupper() method

Last Updated : 11 Jul, 2025

isupper() method in Python checks if all the alphabetic characters in a string are uppercase. If the string contains at least one alphabetic character and all of them are uppercase, the method returns True. Otherwise, it returns False.

Let's understand this with the help of an example:

Python
s = "GEEKSFORGEEKS"
print(s.isupper())  
Explanation: Syntax of method

string.isupper()

Parameters Return Type Examples of method Checking a string with all uppercase letters

Let’s examine a case where the string is entirely uppercase, we can use this to validate input when uppercase formatting is required, such as for acronyms or constants.

Python
s1 = "PYTHON"
print(s1.isupper())  
Explanation: Checking a string with mixed case letters

This method is helpful when we want to ensure that no lowercase letters are present in a string.

Python
s2 = "PyThOn"
print(s2.isupper())  
Explanation: Checking a string with non-alphabetic characters

Let’s check how isupper() behaves when the string contains numbers or special characters.

Python
s3 = "123#@!"
print(s3.isupper())  
Explanation: String with spaces and uppercase letters

This method is useful when validating input strings with uppercase letters and spaces, such as titles or banners.

Python
s4 = "PYTHON IS FUN"
print(s4.isupper())  
Explanation: 5. An empty string

This is useful when we want to ensure that we’re working with meaningful input before applying further processing.

Python
s5 = ""
print(s5.isupper())  
Explanation:

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4