Simple python code about double loop
<p>I tested the following python code on Spyder IDE. Thinking it would output 2d array <code>q</code> as increasing number as 0..31 from <code>q[0][0]</code> to <code>q[3][7]</code>. But it actually returns q as:</p>

<pre><code>[[24, 25, 26, 27, 28, 29, 30, 31], [24, 25, 26, 27, 28, 29, 30, 31], [24, 25, 26, 27, 28, 29, 30, 31], [24, 25, 26, 27, 28, 29, 30, 31]]. 
</code></pre>

<p>The code: </p>

<pre><code>q=[[0]*8]*4 
for i in range(4): 
    for j in range(8): 
        q[i][j] = 8*i+j 
print q
</code></pre>

<p>Any idea of what's happening here? I debugged step by step. It shows the updates of every row will sync with all other rows, quite different from my experience of other programing languages.</p>
