Start learning free

LESSON 70 OF 673 · STRINGS I

Uppercase and Lowercase in Python

Lesson

In Python, strings have built-in methods to change their case:

s.upper()   # converts all characters to uppercase
s.lower()   # converts all characters to lowercase

Here are some examples:

word = "Hello World"
print(word.upper())  # "HELLO WORLD"
print(word.lower())  # "hello world"

name = "ALICE"
print(name.lower())  # "alice"

These methods return a new string — the original is not modified.


Assignment
Follow the Coding Tutorial and convert word to both uppercase and lowercase!


Hint
Use word.upper() and word.lower().

STEP 1 OF 2
    Ctrl + Enter to check