An ipynb version of this section is here.

Notes for the article Python List Comprehensions: Explained Visually by Trey Hunner