title: Python how to compare string in a list with dict
body: <p>I have a code like this:
  It will print <code>Student</code></p>
  
  <pre><code>d= u'pen hahahahaha'
  area  = [u'Apple',u'Banana',u'lemon']
  area2 = [ u'pen',u'book',u'chair' ]
  area3 = [u'father',u'mother']
  if any(d.startswith(i) for i in area):
      category = 'Fruit'
      print 'Fruit'
  elif any(d.startswith(i) for i in area2):
      category = 'Student'
      print 'Student'
  elif any(d.startswith(i) for i in area3):
      category = 'family'
      print 'family'
  </code></pre>
  
  <p>I want to know how to edit it to a mode like this:  </p>
  
  <pre><code>aa = [{"Fruit":[u'Apple',u'Banana',u'lemon']},
        {"Student":[ u'pen',u'book',u'chair' ]},
        {"Family":[u'father',u'mother']}]
  </code></pre>
  
  <p>So I can compare if <code>'pen hahahahaha'</code> in <code>{"Student":[ u'pen',u'book',u'chair' ]}</code><br>
  save <code>category = 'Student'</code></p>
  
  <p>I think for a while but have no idea,please guide me.Thank you</p>