Question: Write a Python program that forms a dictionary called countries that associates the population with each of the following countries (in millions): Algeria 37.1 Canada

Write a Python program that forms a dictionary called countries that associates the population with each of the following countries (in millions):

Algeria 37.1

Canada 3.49

Uganda 32.9

Morocco 32.7

Sudan 30.9

Canada 34.9 # a correction to the error above.

and then prints the length of the countries dictionary, the sorted list of the keys in countries and a sorted list of the values in countries. There should be six assignment statements in your program (seven if you include initializing the dictionary) and three lines of output from your program. Please initialize your dictionary using dict() rather than {}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!