title: Appending to a list in Python: adds last element every time?
body: <p>I want to append a dict to a list, but the result I'm getting isn't what I want.</p>
  
  <p>My code: </p>
  
  <pre><code>records=[]
  record={}
  for i in range(0,2):
    record['a']=i  
    for j in range (0,2):
      record['b']=j
      records.append(record)
  print records 
  </code></pre>
  
  <p>I expected: </p>
  
  <pre><code>[{'a': 0, 'b': 0}, {'a': 0, 'b': 1}, {'a': 1, 'b': 0}, {'a': 1, 'b': 1}]
  </code></pre>
  
  <p>I get instead:</p>
  
  <pre><code>[{'a': 1, 'b': 1}, {'a': 1, 'b': 1}, {'a': 1, 'b': 1}, {'a': 1, 'b': 1}]
  </code></pre>
  
  <p>Why is it only adding the last element every time?</p>