title: What is the under the hood reason that we can use nested for loops in list comprehensions
body: <p>I've been studying list comprehensions and something stopped me for days.</p>
  
  <p>A simple list comprehension has the form</p>
  
  <p><code>[expression for item in iterable]</code></p>
  
  <p>the equivalent <code>for</code> loop is </p>
  
  <pre><code>li=[]
  for item in iterable
      li.append(item)
  </code></pre>
  
  <p>If I'm right what generally a list comprehension does is it iterates through the iterable, evaluates the expression for each iteration, then appends it to the list. </p>
  
  <p>Whatever should happen inside the <code>for</code> loop is written at the beginning of the liscomp. </p>
  
  <p>We can think that in a listcomp Python only allows one expression and <code>for</code> loop's suit is permitted to have only an <code>if</code> clause or nested <code>for</code> loops.</p>
  
  <p>To quote a book I was reading it states that</p>
  
  <blockquote>
    <p><i>Since list comprehensions produce lists, that is, iterables, and since the syntax for list comprehensions requires an iterable, it is possible to nest list comprehensions. This is the equivalent of having nested <code>for … in</code> loops.</i></p>
  </blockquote>
  
  <p>This confused my understanding.</p>
  
  <p>Does this says the reason for having a listcomp like <code>[s+z for s in iterable_1 for z in iterable_2]</code> </p>
  
  <p>Can someone please explain what this says.</p>