Can someone please explain this Python code? : <p>Whilst I know what this piece of code does i have no clue how it achieves it. Can someone please explain it in the dumbest way?</p>

<pre><code>vec = [[1,2,3], [4,5,6], [7,8,9]]
[num for elem in vec for num in elem]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
</code></pre>

<p>The first for part of the code returns this:</p>

<pre><code>[num for elem in vec]
[0, 0, 0]
</code></pre>

<p>Are they indexes for each nested lists first entry?</p>

<p>Thanks!</p>
