Home / Python / Day 7: Intermediate Python / Comprehensions

Comprehensions

Comprehensions provide concise, readable syntax for creating lists, dicts, and sets.

Python Comprehensions

Comprehensions create new collections from existing ones in a single, readable line. They are more Pythonic and often faster than equivalent loops.