title: List of values for duplicate keys in dictionary Python
body: <p>Apologies in advance if this question has already been explored here - I looked at different answers here but couldn't find what I need.</p>
  
  <p>My goal is to create a dictionary like this -- <code>{'a':[10, 9, 10, 10], 'b':[10, 9, 1, 0], 'c':[0, 5, 0, 1], and so on}</code></p>
  
  <p>What I have is multiple dictionaries with duplicate keys (same keys in every other dictionary), something like this
  <code>{'a':10, 'b': 0, 'c': 2}</code>
  <code>{'a':7, 'b': 4, 'c': 4}</code>
  <code>{'a':4, 'b': 5, 'c': 3}</code></p>
  
  <p><em>I have no way of knowing the number of such dictionaries, or if there are keys continuing up to 'f', or a 'g' in them but I know that the keys are duplicated</em>. I've tried <code>defaultdict</code> but what I get is--</p>
  
  <pre><code>defaultdict(&lt;type 'list'&gt;, {'a': [10]})
  defaultdict(&lt;type 'list'&gt;, {'a': [10], 'b': [3]})
  defaultdict(&lt;type 'list'&gt;, {'a': [10], 'b': [3], 'c': [0]})
  </code></pre>
  
  <p>and then the same thing for the next dictionary --</p>
  
  <pre><code>defaultdict(&lt;type 'list'&gt;, {'a': [4]})
  defaultdict(&lt;type 'list'&gt;, {'a': [4], 'b': [5]})
  defaultdict(&lt;type 'list'&gt;, {'a': [4], 'b': [5], 'c': [1]})
  </code></pre>
  
  <p>The code I have for the above output is --</p>
  
  <pre><code>d = collections.defaultdict(list)
      for k, v in z.iteritems():
          d[k].append(v)
          c = d.items()
          print d
  </code></pre>
  
  <p>If I do a <code>print c</code> instead (to print the <code>d.items()</code>) I get --</p>
  
  <pre><code>[('a', [10])]
  [('a', [10]), ('b', [3])]
  [('a', [10]), ('c', [0]), ('b', [3])]
  </code></pre>
  
  <p>which is again repeated for each dictionary. How do I get 1 dict holding all the keys, values -- </p>
  
  <pre><code>{'a':[10,0,..], 'b':[4, 3, 4,..], etc.} ?
  </code></pre>
  
  <p>I should also add that the dicts I have are the result of a for loop and not stored individually in a unique variable.</p>