I just had a similar problem, and found this question and the answers really useful. Here's the part I was confused about. I'm writing it explicitly because no one actually stated it simply in English:
The iteration goes at the end.
Normally, a loop goes
for this many times:
if conditional:
do this thing
else:
do something else
Everyone states the list comprehension part simply as the first answer did,
[ expression for item in list if conditional ]
but that's actually not what you do in this case. (I was trying to do it that way)
In this case, it's more like this:
[ expression if conditional else other thing for this many times ]