str.upper() vs str.lower()
str.upper() and str.lower() are both Python String Methods APIs, and choosing between them is a common point of confusion. This page compares their syntax, parameters, return values, and typical use cases so you can pick the right one. str.upper(): Returns a copy of the string with all characters converted to uppercase. Its syntax is str.upper(), and it returns uppercase string str.lower(): Returns a copy of the string with all characters converted to lowercase. Its syntax is str.lower(), and it returns lowercase string Example of str.upper(): "hello".upper() # "HELLO". Example of str.lower(): "HELLO".lower() # "hello". Read the full references for str.upper() and str.lower() to see parameters, edge cases, and example code side by side. Other String Methods APIs worth comparing: str.capitalize(), str.title(), str.strip(), str.lstrip(), str.rstrip(), str.split(). Both belong to the String Methods category in the Python Reference documentation. Try both in the Python playground to see the behavioral difference live.