Ask Question
13 September, 21:36

Make a dictionary called cities. (code in python)

Use the names of three cities as keys in your dictionary.

Create a dictionary of information about each city and include the country that the city is in, its approximate population, and one fact about that city.

Print the name of each city and all of the information you have stored about it.

+3
Answers (1)
  1. 14 September, 01:12
    0
    cities = {

    'New York': ['United States', 8620000, 'Fact 1'],

    'Paris': ['France', 2140000, 'Fact 2'],

    'London': ['England', 8140000, 'Fact 3'],

    }

    for city in cities:

    print ("City:", cities[city][0])

    print ("Population:", cities[city][1])

    print ("Fact:", cities[city][2])

    print ()
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Make a dictionary called cities. (code in python) Use the names of three cities as keys in your dictionary. Create a dictionary of ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers