The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Call Python’s built-in upper() method: text.upper(). It returns a new string with cased characters converted to uppercase; assign that result if you want to keep it.
Use str.upper() to convert a string
Call upper() on the string, then use or print the returned value:
text = "Hello, Python!"
uppercase_text = text.upper()
print(uppercase_text) # HELLO, PYTHON!
upper() is a built-in string method, so you do not need an import or an external package. Python’s documentation describes it as returning a copy of the string with its cased characters converted to uppercase: Built-in Types — Python 3.14.8 documentation.
Keep the uppercase result
Strings are not changed in place by upper(). The method returns a new string, so assign the result to a variable if you need to retain it. To replace the value stored under the original variable name, write:
#1 Best Overall
text = text.upper()
Use casefold() for matching, not uppercase display
upper() is the appropriate choice when you want uppercase text to display. For caseless text matching, Python provides casefold(), which is a more aggressive conversion intended for that purpose; it is not a substitute for producing uppercase output. See the Python string-method documentation.
Unicode characters and isupper()
Python strings support Unicode, and the documentation says the uppercasing algorithm is described in section 3.13 of the Unicode Standard. Casing behavior therefore applies to Unicode characters, not just the English alphabet.
Rank #2
Do not treat result.isupper() as a universal check that every character in a string is uppercase. Python documents that s.upper().isupper() can still be false when the result contains uncased characters or characters in the titlecase category. The documentation for upper() and isupper() explains this caveat.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




