Create a dictionary named Cities, which uses three city names as keys, and a dictionary for each city that contains the country that the city belongs to, an approximate population, and a fact about the city.
In the dictionary that represents each city, you should include keys such as country, population, and fact. Print out the names of each city and information about them
Cities = {
"Beijing": {"Country": "China",
"Population": "17.4 million",
"Fact": "Capital"},
"London": {"Country": "The Same",
"Population": "8.6 million",
"Fact": "Europe ' s largest city"},
"Berlin": {"Country": "Germany",
"Population": "3.45 million",
"Fact": "Capital"},
}
For city, info in Cities.items ():
Print ("{} ' s information:". Format (City.title ()))
For value, Value_ in Info.items ():
Print ("\ t" + Value, end= ":")
Print (Value_)
Knowledge Points: dictionaries nested in dictionaries
Getting started with Python to practice-exercise 6-11