Ask Question

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.

+5
Answers (1)
  1. 23 December, 11: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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers