title: Find value matching value in a list of dicts
body: <p>I have a list of dicts that looks like this:</p>
  
  <pre><code>serv=[{'scheme': 'urn:x-esri:specification:ServiceType:DAP',
    'url': 'http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/air.mon.anom.nobs.nc'},
   {'scheme': 'urn:x-esri:specification:ServiceType:WMS',
    'url': 'http://www.esrl.noaa.gov/psd/thredds/wms/Datasets/air.mon.anom.nobs.nc?service=WMS&amp;version=1.3.0&amp;request=GetCapabilities'},
   {'scheme': 'urn:x-esri:specification:ServiceType:WCS',
    'url': 'http://ferret.pmel.noaa.gov/geoide/wcs/Datasets/air.mon.anom.nobs.nc?service=WCS&amp;version=1.0.0&amp;request=GetCapabilities'}]
  </code></pre>
  
  <p>and I want to find the URL corresponding to the <code>ServiceType:WMS</code> which means finding the value of <code>url</code> key in the dictionary from this list where the <code>scheme</code> key has value <code>urn:x-esri:specification:ServiceType:WMS</code>.</p>
  
  <p>So I've got this that works:</p>
  
  <pre><code>for d in serv:
      if d['scheme']=='urn:x-esri:specification:ServiceType:WMS':
          url=d['url']
  print url
  </code></pre>
  
  <p>which produces</p>
  
  <pre><code>http://www.esrl.noaa.gov/psd/thredds/wms/Datasets/air.mon.anom.nobs.nc?service=WMS&amp;version=1.3.0&amp;request=GetCapabilities
  </code></pre>
  
  <p>but I've just watched <a href="https://speakerdeck.com/pyconslides/transforming-code-into-beautiful-idiomatic-python-by-raymond-hettinger" rel="nofollow">Raymond Hettinger's PyCon talk</a> and at the end he says that that if you can say it as a sentence, it should be expressed in one line of Python.</p>
  
  <p>So is there a more beautiful, idiomatic way of achieving the same result, perhaps with one line of Python?</p>
  
  <p>Thanks,
  Rich</p>