String Methods
upper()
Return an uppercase copy of text.
str.upper()
str.upper() returns a copy of the string with all cased characters converted to uppercase.
Result
Returns
A new string with cased characters converted to uppercase.
Run it
Try it
Run it and change it
text = "HeLLo" print(text.upper())
Output
Press Run to see what it prints.Worth knowing
- Case conversions: Non-alphabetical characters (numbers, punctuation) are unaffected.