Dynamically creating list in a dictionary using Python : <p>I have thousands of products with ingredients of each for example:</p>

<pre><code>ProductID  | Ingredients
 00001     |  itemA, itemB, itemC, itemD
 00002     |  itemF, itemD, itemG, itemA, itemI
 00003     |  itemH, itemI, itemD, itemF, itemT,itemB, itemC
</code></pre>

<p>........ and so on.</p>

<p>I want to make a unique list of ingredients and make a map that what ingredients are in which product. So For example I want the resulting output in the following way:</p>

<pre><code>{itemA: [00001,00011, 00005,00007]}
{itemB: [00003, 00002, 000056]}
{itemC: [00009, 00087, 00044, 00647, 00031, 00025]}
</code></pre>

<p>So the list size will be different for each item. Can somebody help me out in solving this problem? Thanks</p>
