title: Check key exist in python dict
body: <p>Below is the file output:</p>
  
  <pre><code>apples:20
  orange:100
  </code></pre>
  
  <p>Below is the code:</p>
  
  <pre><code>d = {}
  with open('test1.txt') as f:
      for line in f:
          if ":" not in line:
                  continue
          key, value = line.strip().split(":", 1)
          d[key] = value
  
  for k, v in d.iteritems():
      if k == 'apples':
           v = v.strip()
           if v == 20:
               print "Apples are equal to 20"
           else:
               print "Apples may have greater than or less than 20"   
      if k == 'orrange':
           v = v.strip()
           if v == 20:
              print "orange are equal to 100"
           else:
              print "orange may have greater than or less than 100"
  </code></pre>
  
  <p>In above code i am written "if k == 'orrange':", but its actually "orange" as per output file.</p>
  
  <p>In this case I have to print orrange key is not exist in output file. Please help me. How to do this  </p>