O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

6-11. Cities:

From

Cover of Python Crash Course

Note

cities = {'boston': {'country': 'America', 'poplulation': 0, 'fact': 'beautiful'}, 'beijing': {'country': 'China', 'poplulation': 0, 'fact': 'large'}, 'tokyo': {'country': 'Japan', 'poplulation': 0, 'fact': 'crowded'}}

for city, values in cities.items(): print("\nCity: " + city.title()) for k, v in values.items(): print(k + ": " + str(v))