# Comprehensions: New Lists in One Line

A comprehension builds a new list, dictionary or set from another collection in one line, written as what goes in, for each item, if a condition holds, and replaces the empty-list-and-append loop whenever the whole job is building one collection.

![Cheat sheet: Comprehensions: New Lists in One Line](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/e641a5cd0db949d4a4cdc2e561d4bca8.webp)

- Category: Python
- Level: Apprentice
- Tags: Dictionary Comprehension, List Comprehension, python, Set Comprehension
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/python-comprehensions-cheat-sheet
