When should you not use a list comprehension? PREMIUM

Topic Series: Comprehensions

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:14

When should you not use a list comprehension?

List comprehensions are for building up new lists

We have a list of strings that represent fruits:

```pycon

fruits = ["lime", "blue...

Write more Pythonic code

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