title: Best way to get multiple values from dict
body: <p>I have a list of dict objects like this:</p>
  
  <pre><code>[{'emailAddress': 'user1@example.com', 'country': 'US'},
  {'emailAddress': 'user2@example.com', 'country': 'CA'},
  {'emailAddress': 'user3@example.com', 'country': 'UK'}]
  </code></pre>
  
  <p>The list of dict objects is just over 200k records long.</p>
  
  <p>What I'd like to do is find the country for a list of email addresses.  For example, if I have a list like this:</p>
  
  <pre><code>['user1@example.com', 'user3@example.com']
  </code></pre>
  
  <p>I'd like it to return this:</p>
  
  <pre><code>['US', 'UK']
  </code></pre>
  
  <p>Now I can do this by defining a function like this:</p>
  
  <pre><code>def getBaseOUs(emailAddresses):
      countries = []
      for emailAddress in emailAddresses:
          for user in usermap:
              if emailAddresses == user['emailAddress']:
                  countries.append(user['country'])
      return countries
  </code></pre>
  
  <p>But am wondering what people think the fastest / most cpu efficient way of doing this would be?</p>
  
  <p>Thank you.</p>