What are list comprehensions?


List comprehensions are one of Python's most distinctive features -- a concise, readable syntax for creating lists by transforming and filtering elements from existing iterables. They replace multi-line for loop patterns with a single expression that is both easier to read and faster to execute.

The basic syntax...