Turning a list comprehension into a generator expression PREMIUM

Topic Series: Generator Expressions

Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
3 minute read Works on Python 3.7—3.10
Python Morsels
Watch as video
03:13

When can you turn a list comprehension into a generator expression?

Passing a comprehension to a function

We're taking a [list comprehension](https://www.pythonmorsels.com/topics/what-a...

Write more Pythonic code

Need to fill-in gaps in your Python skills? I send regular emails designed to do just that.

Python Morsels
Watch as video
03:13