# sorted()

*noun*

say it: **“SOR-tid”** **/ˈsɔrtɪd/**

A built-in Python function that gives back a new list in order and leaves the original as it was.

## What does `sorted()` do?

`sorted()` gives back a new, sorted list and leaves the original alone.

```python
names = ["Zoe", "Adam", "Mia"]
print(sorted(names))  # ['Adam', 'Mia', 'Zoe']
print(names)          # ['Zoe', 'Adam', 'Mia']
```

## In a sentence

- “**sorted()** gave the names in alphabetical order while the sign-up list kept its order.”
- “The report used **sorted()** with key=len to list words from shortest to longest.”

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/sorted
