title: Python - How to fix “ValueError: not enough values to unpack (expected 2, got 1)”
body: <p>I need to write a function <code>add_to_dict(d, key_value_pairs)</code> which adds each given key/value pair to a python dictionary. The argument <code>key_value_pairs</code> will be a list of tuples in the form <code>(key, value)</code>.</p>
  <p>The function should return a list of all of the key/value pairs which have changed (with their original values).</p>
  <pre><code>def add_to_dict(d, key_value_pairs):
  
     newlist = []
  
     for key,value in d:
         for x,y in key_value_pairs:
             if x == key:
                newlist.append(x,y)
              
     return newlist
  </code></pre>
  <p>I keep getting an error</p>
  <blockquote>
  <p>ValueError: not enough values to unpack (expected 2, got 1)</p>
  </blockquote>
  <p>How do I solve this error?</p>