title: How to deep copy a list?
body: <p>After <code>E0_copy = list(E0)</code>, I guess <code>E0_copy</code> is a deep copy of <code>E0</code> since <code>id(E0)</code> is not equal to <code>id(E0_copy)</code>. Then I modify <code>E0_copy</code> in the loop, but why is <code>E0</code> not the same after?</p>
  <pre><code>E0 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
  for k in range(3):
      E0_copy = list(E0)
      E0_copy[k][k] = 0
      #print(E0_copy)
  print E0  # -&gt; [[0, 2, 3], [4, 0, 6], [7, 8, 0]]
  </code></pre>