title: Python - shortening an if / for loop
body: <p>I've got a few lines of code for iterating over a dict within a list and I'm looking to shorten it. It works perfectly as is, but seems like too much code and I'm trying to get a feel for how to keep code efficient in Python (or in general really).</p>
  
  <pre><code>for d in dev['devices']:
      if d['name'] == devName:
          devFound = True
          break
  </code></pre>
  
  <p>The structure of 'dev' is a bit confusing but for the data I care about:
  dev (dict) > devices (list) > 0-n (dict)</p>
  
  <p>the value 'name' is a key within the inner numbered dict (varies depending on the search value elsewhere) which needs to be checked against a user input (devName)</p>
  
  <p>Any input much appreciated</p>