Python String isupper() method Last Updated : 02 Jan, 2025 Comments Improve Suggest changes Like Article Like Report 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()) OutputTrue Explanation:The string 's' contains only uppercase alphabetic characters.Therefore, the isupper() method returns True.This method helps us verify that all characters intended to be uppercase are correctly formatted.Table of ContentSyntax of isupper() methodExamples of isupper() methodFrequently Asked Questions (FAQs) on issuper() methodSyntax of methodstring.isupper()ParametersThe isupper() method does not take any parameters.Return TypeReturns True if all alphabetic characters in the string are uppercase.Returns False if the string contains lowercase letters or non-alphabetic characters.Examples of methodChecking a string with all uppercase lettersLet’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()) OutputTrue Explanation:The string s1 is made up entirely of uppercase alphabetic characters.The method returns True, confirming that all alphabetic characters in s1 are uppercase.Checking a string with mixed case lettersThis method is helpful when we want to ensure that no lowercase letters are present in a string. Python s2 = "PyThOn" print(s2.isupper()) OutputFalse Explanation:The string s2 contains both uppercase (P, T, O) and lowercase (y, h, n) characters.As a result, isupper() returns False.Checking a string with non-alphabetic charactersLet’s check how isupper() behaves when the string contains numbers or special characters. Python s3 = "123#@!" print(s3.isupper()) OutputFalse Explanation:The string s3 contains only non-alphabetic characters (numbers and special symbols).Since there are no uppercase alphabetic characters, isupper() returns False.String with spaces and uppercase lettersThis 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()) OutputTrue Explanation:The string s4 contains uppercase alphabetic characters and spaces.Spaces are non-alphabetic characters and do not affect the result.The method returns True, confirming that all alphabetic characters in s4 are uppercase.5. An empty stringThis is useful when we want to ensure that we’re working with meaningful input before applying further processing. Python s5 = "" print(s5.isupper()) OutputFalse Explanation:The string s5 is empty and does not contain any characters.The isupper() method returns False since there are no uppercase alphabetic characters to validate. Comment More infoAdvertise with us Next Article Python String isupper() method manjeet_04 Follow Improve Article Tags : Python python-string Python-string-functions Practice Tags : python Similar Reads Python String format() Method format() method in Python is a tool used to create formatted strings. By embedding variables or values into placeholders within a template string, we can construct dynamic, well-organized output. It replaces the outdated % formatting method, making string interpolation more readable and efficient. E 8 min read Python String format_map() Method Python String format_map() method is an inbuilt function in Python, which is used to return a dictionary key's value. Syntax: string.format_map(z) Parameters: Here z is a variable in which the input dictionary is stored and string is the key of the input dictionary. input_dict: Takes a single parame 2 min read Python String index() Method The index() method in Python is used to find the position of a specified substring within a given string. It is similar to the find() method but raises a ValueError if the substring is not found, while find() returns -1. This can be helpful when we want to ensure that the substring exists in the str 2 min read Python String isalnum() Method The isalnum() method is a string function in Python that checks if all characters in the given string are alphanumeric. If every character is either a letter or a number, isalnum() returns True. Otherwise, it returns False. For Example:Pythons = "Python123" res = s.isalnum() print(res)OutputTrue Exp 2 min read Python String isalpha() Method The isalpha() method checks if all characters in a given string are alphabetic. It returns True if every character in the string is a letter and False if the string contains any numbers, spaces, or special characters.Letâs start with a simple example of using isalpha()Pythons1 = "HelloWorld" res1 = 2 min read Python string isdecimal() Method In Python, the isdecimal() method is a quick and easy way to check if a string contains only decimal digits. It works by returning True when the string consists of digits from 0 to 9 and False otherwise. This method is especially useful when we want to ensure that user inputs or string data are stri 3 min read Python String isdigit() Method The isdigit() method is a built-in Python function that checks if all characters in a string are digits. This method returns True if each character in the string is a numeric digit (0-9) and False otherwise. Example:Pythona = "12345" print(a.isdigit()) b = "1234a5" print(b.isdigit())OutputTrue False 3 min read Python String isidentifier() Method The isidentifier() method in Python is used to check whether a given string qualifies as a valid identifier according to the Python language rules. Identifiers are names used to identify variables, functions, classes, and other objects. A valid identifier must begin with a letter (A-Z or a-z) or an 3 min read Python String islower() Method The islower() method in Python checks if all characters in a string are lowercase. It returns True if all alphabetic characters are lowercase, otherwise, it returns False, if there is at least one uppercase letter.Let's look at a quick example of using the islower() method.Pythons = "hello" res = s. 2 min read Python String isnumeric() Method The isnumeric() method is a built-in method in Python that belongs to the string class. It is used to determine whether the string consists of numeric characters or not. It returns a Boolean value. If all characters in the string are numeric and it is not empty, it returns âTrueâ If all characters i 3 min read Like