# split()

say it: **“SPLIT”** **/ˈsplɪt/**

Breaks a string into a list of pieces.

## What does `split()` do?

`split()` breaks a string into a list of pieces. By default it splits on spaces; you can pass a different separator.

```python
line = "Ana,32,Denver"
parts = line.split(",")
print(parts)  # ['Ana', '32', 'Denver']
```

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

Updated: November 17, 2026

## In other subjects

- [Split() in C#](https://www.ask-codey.com/glossary/split-c-sharp)
- [split() in JavaScript](https://www.ask-codey.com/glossary/split-javascript)

Source: https://www.ask-codey.com/glossary/split
