title: Making multiple calls with asyncio and adding result to a dictionary
body: <p>I am having trouble wrapping my ahead around Python 3's Asyncio library. I have a list of zipcodes and I am trying to make async calls to an API to get each zipcodes corresponding city and state. I can do it successfully in sequence with a for loop but I want to make it faster in the case of a big zipcode list.</p>
  
  <p>This is an example of my original that works</p>
  
  <pre><code>import urllib.request, json
  
  zips = ['90210', '60647']
  
  def get_cities(zipcodes):
      zip_cities = dict()
      for idx, zipcode in enumerate(zipcodes):
          url = 'http://maps.googleapis.com/maps/api/geocode/json?address='+zipcode+'&amp;sensor=true'
          response = urllib.request.urlopen(url)
          string = response.read().decode('utf-8')
          data = json.loads(string)
          city = data['results'][0]['address_components'][1]['long_name']
          state = data['results'][0]['address_components'][3]['long_name']
          zip_cities.update({idx: [zipcode, city, state]})
      return zip_cities
  
  results = get_cities(zips)
  print(results)
  # returns {0: ['90210', 'Beverly Hills', 'California'],
  #          1: ['60647', 'Chicago', 'Illinois']}
  </code></pre>
  
  <p>This is my terrible non-functional attempt at trying to make it async</p>
  
  <pre><code>import asyncio
  import urllib.request, json
  
  zips = ['90210', '60647']
  zip_cities = dict()
  
  @asyncio.coroutine
  def get_cities(zipcodes):
      url = 'http://maps.googleapis.com/maps/api/geocode/json?address='+zipcode+'&amp;sensor=true'
      response = urllib.request.urlopen(url)
      string = response.read().decode('utf-8')
      data = json.loads(string)
      city = data['results'][0]['address_components'][1]['long_name']
      state = data['results'][0]['address_components'][3]['long_name']
      zip_cities.update({idx: [zipcode, city, state]})
  
  loop = asyncio.get_event_loop()
  loop.run_until_complete([get_cities(zip) for zip in zips])
  loop.close()
  print(zip_cities) # doesnt work
  </code></pre>
  
  <p>Any help is much appreciated. All of the tutorials I've come across online seem to be a tad over my head.</p>
  
  <p>Note: I've seen some examples use <code>aiohttp</code>. I was hoping to stick with the native Python 3 libraries if possible.</p>