List Comprehension
List Comprehension — A list comprehension is a concise way to create lists by iterating over an iterable and optionally filtering elements. List comprehensions are more Pythonic and faster than traditional for loops for simple transformations. The syntax is `[expression for item in iterable if condition]`. They can be nested and include multiple for clauses. For large datasets, consider generator expressions `(expr for item in iterable)` for memory efficiency. This term relates to the Built-in Functions category of the reference. You will meet list comprehension in practice when working with APIs such as print(), len(), range(), type(). Related terms: Decorator, Generator, Context Manager, GIL (Global Interpreter Lock), Duck Typing, Mutable vs Immutable. Understanding list comprehension makes the rest of the Python documentation noticeably easier to follow, because the concept recurs across function references, guides, snippets, and error messages you will meet in real projects.