Ask Question
13 December, 02:06

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.

+1
Answers (1)
  1. 13 December, 04:49
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers