How do I build a dict using list comprehension?
<p>How do I build a dict using list comprehension?</p>

<p>I have two lists.</p>

<pre><code> series = [1,2,3,4,5]
 categories = ['A', 'B', 'A', 'C','B']
</code></pre>

<p>I want to build a dict where the categories are the keys.</p>

<p>Thanks for your answers I'm looking to produce:</p>

<pre><code> {'A' : [1, 3], 'B' : [2, 5], 'C' : [4]}
</code></pre>

<p>Because the keys can't exist twice</p>
