Country Capitals¶
Download both files into the same folder.
What you should do¶
Modify the
country_capitals.py
code to display the name and capital city for every country as shown below.... ... Country: Western Sahara Capital: El-Aai Country: Yemen Capital: Sanaa Country: Zambia Capital: Lusaka Country: Zimbabwe Capital: Harare
Convert the loading of the JSON file into a function called
load_countries
. It will have one parameter, the name of the file to load. It will return a list of country dictionaries.
©2021 Daniel Gallo
This work is licensed under Attribution-NonCommercial-ShareAlike 4.0 International