title: Python nested list comprehension (accessing nested elements)
body: <p>I'm having trouble understanding the syntax here. </p>
  
  <pre><code>matrix_a = [[1, 2], [3, 4], [5, 6]]
  matrix_b = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
  
  [a for a, b in matrix_a]
  </code></pre>
  
  <p>output: <code>[1, 3, 5]</code> </p>
  
  <pre><code>[a for b, a in matrix_a] 
  </code></pre>
  
  <p>output: <code>[2, 4, 6]</code></p>
  
  <p>I understand a little about how list-comprehensions work, but I don't understand the syntax when accessing certain elements within a nested list. </p>
  
  <p>I just can't wrap my head around this syntax. How is this syntax working? What does the comma represent? What does <code>a for a</code> mean? Can you explain whats going on under the hood? And finally how would you do this with <code>matrix_b</code></p>