List comprehensions confuse beginners because they read backwards from how most people think about loops.

Here is a three-step method that works for every list comprehension you will ever see, including the nested ones that make experienced developers slow down.

The Three Steps

Step 1: Find the output expression (what goes into the list)

Step 2: Find the iteration (where the values come from)