Add to list vs. Increment
<p>Given that in Python:</p>

<pre><code>element = element + [0]
</code></pre>

<p>should be equal to:</p>

<pre><code>element += [0]
</code></pre>

<p>Why does one modify a list and the other does not? Here is a example:</p>

<pre><code>&gt;&gt;&gt; a = [[0, 0], [0,0]]
&gt;&gt;&gt; for element in a:
...     element = element + [0]
... 
&gt;&gt;&gt; a
[[0, 0], [0, 0]]
</code></pre>

<p>a is not modified. But if I increment:</p>

<pre><code>&gt;&gt;&gt; a = [[0, 0], [0,0]]
&gt;&gt;&gt; for element in a:
...     element += [0]
...
&gt;&gt;&gt; a
[[0, 0, 0], [0, 0, 0]]
</code></pre>

<p>a is modified.</p>

<p>Thanks,
Frank</p>
