title: Python: Updating a list of values in a dictionary
body: <p>I have created a dictionary called <strong>matrix</strong> that has a keys 0 to 3 and then the values are a list of names.  Each key has the same values (the list of names).  As I assign a node to a name I would like to update the dictionary to remove that name from only one key.As the code below shows, if I want to update key 0 by removing the value "jason", it removes "jason" from all of the other keys as well. I still need "jason" to be a value for keys 1 through 3 after it is removed only from key 0.</p>
  
  <pre><code>node = [0,1,2,3]
  names = ["jason", "martin", "ronnie", "mike"]
  
  def table (node, names):
       options = {} 
       for i in range(len(node)):
           options [i] = names
       return options    
  
  matrix = table(node,names)
  print "Before removing Jason: " + str(matrix)
  alist = matrix[0]
  alist.remove('jason')
  matrix[0] = alist
  print "After removing Jason: " + str(matrix)
  print matrix
  </code></pre>
  
  <hr>
  
  <p>I have also included a screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/4vfuO.png" alt="enter image description here"></p>