Editor settings

General settings

Save settings

Learn to program with Python

Make a string uppercase #

You can convert a string to uppercase using the upper() function. This method returns a new string in which all the characters are converted to uppercase.

Here's an example:

my_string = "Hello, World!"
uppercase_string = my_string.upper()
print(uppercase_string) # Output: "HELLO, WORLD!"

Exercise #

  • Use the upper() function to make all the characters in the variable uppercase_string uppercase
  • Do not change the first line of code
Output will be displayed here