Changing the value of a copy also changes the value of the original : <p>Changing the value of a variable b, which is a copy of a, also changes the value of a.</p>

<pre><code>a = [[0]]
b = a.copy()

print("a before", a)

b[0][0] = 1

print("a after ", a)
</code></pre>

<p>prints:</p>

<pre><code>a before [[0]]
a after  [[1]]
</code></pre>

<p>Although this works:</p>

<pre><code>a = [0]
b = a.copy()

print("a before", a)

b[0] = 1

print("a after ", a)
</code></pre>

<p>prints:</p>

<pre><code>a before [[0]]
a after  [[0]]
</code></pre>
