title: Python: JSON get value from list of dictionaries, or print something if list is empty
body: <p>I'm trying to parse a JSON response I get from a web API. The problem is that the JSON can have varying levels, which translate into dictionaries of dictionaries, with an occasional list in the mix.
  Example (this works):</p>
  
  <pre><code>for r in json_doc['results']:
      yield r.get('lastLoginLocation',{}).get('coordinates',{}).get('lat',{})
  </code></pre>
  
  <p>Can I do the same thing when a list of dictionaries is in there? I'd like it to return the specified key value from the first dictionary in the list if the list is populated, or return '{}' if the list is empty.</p>
  
  <p>Example (this does NOT work)</p>
  
  <pre><code>   yield r.get('profile',{}).get('phones',{})[0].get('default',{})
  </code></pre>