upper() method converts all lowercase characters in a string into uppercase characters and returns it
upper()method doesn’t take any parameters.
returns a uppercased string of the given string
CODE 1: String with only alphabetic characters
Original String: geeKs For geEkS Converted String: GEEKS FOR GEEKS
CODE 2: String with alphanumeric characters
Original String: g3Ek5 f0r gE3K5 Converted String: G3EK5 F0R GE3K5
Application: One of the common application of upper() method is to check if the two strings are same or not
Strings are same
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Python String Methods | Set 1 (find, rfind, startwith, endwith, islower, isupper, lower, upper, swapcase & title)
- numpy string operations | upper() function
- Python | Pandas Series.str.lower(), upper() and title()
- Python regex to find sequences of one upper case letter followed by lower case letters
- Python - Extract Upper Case Characters
- Python program to count upper and lower case characters without using inbuilt functions
- isupper(), islower(), lower(), upper() in Python and their applications
- PyQt5 QDial - Setting Upper Bound
- PyQt5 QDial - Getting Upper Bound
- Pandas - Convert the first and last character of each word to upper case in a series
- Python | Check if a given string is binary string or not
- Python | Check if given string can be formed by concatenating string elements of list
- Python | Check if string ends with any string in given list
- Python | Sorting string using order defined by another string
- Python | Merge Tuple String List values to String
- Python | Sort each String in String list
- Python | Convert List of String List to String List
- Python - Length of shortest string in string list
- Python - Remove front K characters from each string in String List
- Python - Remove String from String List
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.