title: multiple values in a dictionary python
body: <p>I have data in following form (saved in a list)</p>
  
  <pre><code>id, price, date, category
  </code></pre>
  
  <p>Now, I basically want to seperate items based on the category..
  basically a dictionary where key is the category and rest of the stuff (id, price, data) are its values
  I have already created a datastructure so lets a datastructre 'item' has the above four stated attributes (id, price, date, category)
  So basically what i want is a dictionary in following form:</p>
  
  <pre><code>{1: [item_1,item_2....], 2:[item....]} 
  </code></pre>
  
  <p>how do i do this..
  Since there are many values in a single key hence i know that it will use defaultdict.. but still I am not able to get around this.
  Thanks</p>