How to change a string into uppercase?
In Python, you can use the built-in upper() method to change a string to uppercase.
In Python, you can use the built-in upper() method to change a string to uppercase. Here's an example:
Change a string into uppercase in Python
python— editable, runs on the server
This will output:
HELLO WORLDYou can also call the upper() method directly on the str class. While this works, using the instance method s.upper() is the standard and more readable Pythonic approach.
Change a string into uppercase in Python using str.upper
python— editable, runs on the server
This will also output:
Change a string into uppercase
HELLO WORLD