Uppercase String in Python

Level 122 keystrokes

This converts 'hello' to uppercase and prints 'HELLO'. The upper() method transforms all letters to uppercase.

Python code

# upper() is a string method that returns a copy with every letter in uppercase
# The dot calls the method on "hello", giving "HELLO", which print() shows
1print("hello".upper())

Output

HELLO
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Python code and how often they appear.

  • "× 2
  • (× 2
  • )× 2
  • .× 1

More Python examples at level 1

← Python typing practice