Append dict to a list in a for-in interation in python when the dict declared out of the list iteration
<p>Like below, why does not the final r print <code>[{'k': 1}, {'k': 2}]</code> ?</p>

<pre><code>l = [1, 2]
d = {}
r = []

for el in l:
    d['k'] = el
    print '&gt; ' + str(d)
    r.append(d)

print r  
</code></pre>

<p>OUTPUT:</p>

<pre><code>&gt; {'k': 1}
&gt; {'k': 2}
[{'k': 2}, {'k': 2}]
</code></pre>

<p>It is printed as wished before append operation, however after the dict is appended to a list, why does it append the last element repeatedly?</p>
