# upper() and lower()

*noun*

say it: **“UP-er and LOH-er”** **/ˈʌpər ænd ˈloʊɚ/**

Python's string methods that give a copy of the text in all capital letters or all small letters, so text typed in different ways can be compared.

## What do `upper()` and `lower()` do?

`upper()` gives an ALL CAPS copy of a string and `lower()` an all lowercase copy. Handy for comparing text without worrying about capitals.

```python
answer = "Yes"
if answer.lower() == "yes":
    print("Confirmed")
print("sale".upper())  # SALE
```

## In a sentence

- “After **lower()**, "MARIA" and "Maria" were the same name.”
- “The signs needed every flavor in capitals, so she used **upper()** on the column.”

Level: Apprentice · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=2)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/upper-and-lower
