title: Iterate over a dictionary by comprehension and get a dictionary
body: <p>How to iterate over a dictionary by dictionary comprehension to process it.</p>
  
  <pre><code>&gt;&gt;&gt; mime_types={
      '.xbm': 'image/x-xbitmap',
      '.dwg': 'image/vnd.dwg',
      '.fst': 'image/vnd.fst',
      '.tif': 'image/tiff',
      '.gif': 'image/gif',
      '.ras': 'image/x-cmu-raster',
      '.pic': 'image/x-pict',
      '.fh':  'image/x-freehand',
      '.djvu':'image/vnd.djvu',
      '.ppm': 'image/x-portable-pixmap',
      '.fh4': 'image/x-freehand',
      '.cgm': 'image/cgm',
      '.xwd': 'image/x-xwindowdump',
      '.g3':  'image/g3fax',
      '.png': 'image/png',
      '.npx': 'image/vnd.net-fpx',
      '.rlc': 'image/vnd.fujixerox.edmics-rlc',
      '.svgz':'image/svg+xml',
      '.mmr': 'image/vnd.fujixerox.edmics-mmr',
      '.psd': 'image/vnd.adobe.photoshop',
      '.oti': 'application/vnd.oasis.opendocument.image-template',
      '.tiff':'image/tiff',
      '.wbmp':'image/vnd.wap.wbmp'
  }
  
  &gt;&gt;&gt; {(key,val) for key, val in mime_types.items() if "image/tiff" == val}
  </code></pre>
  
  <p>This is returning result like this:</p>
  
  <pre><code>set([('.tiff', 'image/tiff'), ('.tif', 'image/tiff')])
  </code></pre>
  
  <p>But I'm expecting </p>
  
  <pre><code>('.tif', 'image/tiff')
  </code></pre>
  
  <p>How can I modify that result to get a dictionary like :</p>
  
  <pre><code>{'.tif': 'image/tiff'}
  </code></pre>