The answer is A, or Locating bottlenecks in a network.
Answer:
- country_pop = {
- 'China': 1365830000,
- 'India': 1247220000,
- 'United States': 318463000,
- 'Indonesia': 252164800
- }
- for key in country_pop:
- print(key + " has " + str(country_pop[key]) + " people")
Explanation:
The solution code is written in Python 3.
Given a dictionary, country_pop with data that includes four country along with their respective population (Line 1-6). We can use for in loop structure to traverse through each of the key (country) in the dictionary and print their respective population value (Line 7-8). The general loop structure through is as follow:
for key in dict:
do something
One key will be addressed for each round of loop and we can use that key to extract the corresponding value of the key (e.g. country_pop[key]) and print it out.