For some reason or another, I'm always second guessing myself when writing nested list comprehensions. Here's a quick example to clarify what's going behind the scenes:
>>> words = ["foo", "bar", "baz"]
>>> [letter for word in words for letter in word]
['f', 'o', 'o', 'b', 'a', 'r', 'b', 'a', 'z']
In other words, the for loops are nested from left-to-right. If we just wanted to print the values in the above example, we could replace the nested list comprehensions with the following for statements:
>>> for word in words:
... for letter in word:
... print letter
...
f
o
o
b
a
r
b
a
z
Hopefully this will clarify nested list comprehensions for future me.