title: Merge dictionaries retaining values for duplicate keys
body: <p>Given n dictionaries, write a function that will return a unique dictionary with a list of values for duplicate keys.</p>
  
  <p>Example:</p>
  
  <pre><code>d1 = {'a': 1, 'b': 2}
  d2 = {'c': 3, 'b': 4}
  d3 = {'a': 5, 'd': 6}
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>&gt;&gt;&gt; newdict
  {'c': 3, 'd': 6, 'a': [1, 5], 'b': [2, 4]}
  </code></pre>
  
  <p>My code so far:</p>
  
  <pre><code>&gt;&gt;&gt; def merge_dicts(*dicts):
  ...     x = []
  ...     for item in dicts:
  ...         x.append(item)
  ...     return x
  ...
  &gt;&gt;&gt; merge_dicts(d1, d2, d3)
  [{'a': 1, 'b': 2}, {'c': 3, 'b': 4}, {'a': 5, 'd': 6}]
  </code></pre>
  
  <p>What would be the best way to produce a new dictionary that yields a list of values for those duplicate keys?</p>