title: Python:how do you append the value of a dictionary key in a list and not the reference?
body: <p>I have a dictionary consisting of names and a list in each key,like below:</p>
  
  <pre><code>dict1={}
  for i in names:
      dict1[i]=[]
  </code></pre>
  
  <p>Then,I process a csv file and I find the result i need,I append it to the corresponding dictonary value,and I append in a list the name and the dictionary value,like below:</p>
  
  <pre><code>list1=[]
  for i2 in data:
      total_score=sum(i2[1:4])
      dict1[i2[0]].append(total_score)
      list1.append([i2[0],dict1[i2[0]]])
  </code></pre>
  
  <p>If i try to print the elements of the list1,I get the final list for each key,and not the progessive list.</p>
  
  <p>The ending list should be like this:</p>
  
  <pre><code>list1=[[name1,[50]],[name1,[50,60]],[name1,[50,60,0,85]]]
  </code></pre>
  
  <p>Any ideas?Thanks.</p>