title: how multiple list comprehension works
body: <p>while trying to print multiple rows and columns using list comprehensions, the following code works</p>
  <pre><code>X=[[x for x in range(y)] for y in range(3)]
  </code></pre>
  <p>but this code does not work</p>
  <pre><code>X=[x for x in range(y) for y in range(3)]
  </code></pre>
  <p>What difference it makes when list is used instead of direct loop. Generally for multiple loops it works from left to right. in this case the loops are working from right to left so we able to use y before y is declared in for .</p>