title: Python Dictionary to List
body: <p>I'm trying to take a dictionary i made with pygeocodio and print a list out from only the county key in the dictionary. </p>
  
  <p>Here is an example of my dictionary </p>
  
  <pre><code>[{'input': {'address_components': {'number': '1600', 'street': 'Pennsylvania', 'suffix': 'Ave', 'postdirectional': 'SE', 'formatted_street': 'Pennsylvania Ave SE', 'city': 'Washington', 'state': 'DC', 'zip': '20003', 'country': 'US'}, 'formatted_address': '1600 Pennsylvania Ave SE, Washington, DC 20003'}, 'results': [{'address_components': {'number': '1600', 'street': 'Pennsylvania', 'suffix': 'Ave', 'postdirectional': 'SE', 'formatted_street': 'Pennsylvania Ave SE', 'city': 'Washington', **'county': 'District of Columbia'**, 'state': 'DC', 'zip': '20003', 'country': 'US'}, 'formatted_address': '1600 Pennsylvania Ave SE, Washington, DC 20003', 'location': {'lat': 38.879138, 'lng': -76.981879}, 'accuracy': 1, 'accuracy_type': 'rooftop', 'source': 'DC Geographic Information Systems Program (DC GIS)'}]}, {'input': {'address_components': {'number': '3101', 'street': 'Patterson', 'suffix': 'Ave', 'formatted_street': 'Patterson Ave', 'city': 'Richmond', 'state': 'VA', 'zip': '23221', 'country': 'US'}, 'formatted_address': '3101 Patterson Ave, Richmond, VA 23221'}, 'results': [{'address_components': {'number': '3101', 'street': 'Patterson', 'suffix': 'Ave', 'formatted_street': 'Patterson Ave', 'city': 'Richmond', **'county': 'Richmond city'**, 'state': 'VA', 'zip': '23221', 'country': 'US'}, 'formatted_address': '3101 Patterson Ave, Richmond, VA 23221', 'location': {'lat': 37.560446, 'lng': -77.476008}, 'accuracy': 1, 'accuracy_type': 'rooftop', 'source': 'Virginia GIS Clearinghouse'}]}]
  </code></pre>
  
  <p>The name of the dictionary is <code>LocationTest</code></p>
  
  <p>This what im currently doing in my python terminal </p>
  
  <pre><code>&gt;&gt;&gt; from geocodio import GeocodioClient
  &gt;&gt;&gt; client = GeocodioClient(MY_KEY)
  &gt;&gt;&gt; locationTest = client.geocode(['1600 Pennsylvania Ave, Washington, DC','3101 Patterson Ave, Richmond, VA, 23221'])
  &gt;&gt;&gt; list(zip(*(locationTest[key] for key in keys)))
  </code></pre>
  
  <p>then i get this error </p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;input&gt;", line 1, in &lt;module&gt;
    File "&lt;input&gt;", line 1, in &lt;genexpr&gt;
  TypeError: list indices must be integers or slices, not str
  </code></pre>
  
  <p>i then ran this </p>
  
  <pre><code>list_key_value = [ [k,v] for k, v in locationTest.items()]
  </code></pre>
  
  <p>and recieved this error </p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;input&gt;", line 1, in &lt;module&gt;
  AttributeError: 'LocationCollection' object has no attribute 'items'
  </code></pre>
  
  <p>Ultimately i want to be able to save all of the County key/value pairs to a csv file in a list or excel spreadsheet? </p>