title: Converting List Comprehensions to For Loops in Python
body: <p>I understand the importance of list comprehensions, but do not understand their inner-workings, thus am not able to understand them in simpler terms such as I would a for loop. For example, how could I change this to a for loop:</p>
  
  <pre><code>li = [row[index] for row in outer_list]
  </code></pre>
  
  <p>In this example I have a list of lists, for my purposes a matrix, called <strong>outer_list</strong> which is a list of lists. The <strong>index</strong> value is the column number the outer iteration is at, from 0 to some number n. The list comprehension above returns the <strong>index</strong>'th column in the matrix, and assigns it to <strong>li</strong> as a list. How can I create a for loop that creates a list in this manner?</p>