title: Whats the best way to access deep nested dicts returned from geocode?
body: <p>I'm trying to access the returned data from google geocode which are deeply nested dicts. I want to access values from for example <code>'long_name': '80331'</code> and <code>'long_name': 'Germany'</code>.</p>
  <h2><strong>Value of</strong></h2>
  <p><code>geocode_result</code></p>
  <pre><code>[{'address_components': [{'long_name': '1',
                            'short_name': '1',
                            'types': ['street_number']},
                           {'long_name': 'Rosenstraße',
                            'short_name': 'Rosenstraße',
                            'types': ['route']},
                           {'long_name': 'Altstadt-Lehel',
                            'short_name': 'Altstadt-Lehel',
                            'types': ['political',
                                      'sublocality',
                                      'sublocality_level_1']},
                           {'long_name': 'München',
                            'short_name': 'München',
                            'types': ['locality', 'political']},
                           {'long_name': 'Oberbayern',
                            'short_name': 'Oberbayern',
                            'types': ['administrative_area_level_2',
                                      'political']},
                           {'long_name': 'Bayern',
                            'short_name': 'BY',
                            'types': ['administrative_area_level_1',
                                      'political']},
                           {'long_name': 'Germany',
                            'short_name': 'DE',
                            'types': ['country', 'political']},
                           {'long_name': '80331',
                            'short_name': '80331',
                            'types': ['postal_code']}],
    'formatted_address': 'Rosenstraße 1, 80331 München, Germany',
    'geometry': {'location': {'lat': 48.136843, 'lng': 11.574534},
                 'location_type': 'ROOFTOP',
                 'viewport': {'northeast': {'lat': 48.1381919802915,
                                            'lng': 11.5758829802915},
                              'southwest': {'lat': 48.1354940197085,
                                            'lng': 11.5731850197085}}},
    'place_id': 'ChIJb5mLKvV1nkcRoLu43AhDUiA',
    'plus_code': {'compound_code': '4HPF+PR Munich, Germany',
                  'global_code': '8FWH4HPF+PR'},
    'types': ['electronics_store',
              'establishment',
              'point_of_interest',
              'store']}]
  </code></pre>
  <h2>My code so far:</h2>
  <pre><code>def get_location(pointOfInterest):
      gmaps = googlemaps.Client(key='KEY')
  
      geocode_result = gmaps.geocode(pointOfInterest)
  
      # street_number = geocode_result[0]['address_components'][0]['long_name']
      
      lat = geocode_result[0]['geometry']['location']['lat']
      lng = geocode_result[0]['geometry']['location']['lng']
  
      pprint(geocode_result)
      # pprint(lng)
  
      search = 'postal_code'
  
      for value, postal_code in geocode_result[0].items():  # for name, age in dictionary.iteritems(): 
          if postal_code == search:
              print(value)
  
  
  get_location('apple munich')
  </code></pre>