Question: Using the program Thonny for the following Question: 1. United Nations The file UN. txt gives data about the 193 members of the United Nations.

Using the program Thonny for the following Question:

Using the program Thonny for the following Question: 1. United Nations Thefile UN. txt gives data about the 193 members of the United

Nations. Each line of the file contains four pieces of data about

1. United Nations The file UN. txt gives data about the 193 members of the United Nations. Each line of the file contains four pieces of data about a country-name, con- tinent, population (in millions), and land area (in square miles). Some lines of the file are Canada, North America, 34.8,3855000 France, Europe, 66.3,211209 New Zealand, Australia/Oceania, 4.4,103738 Nigeria, Africa, 177.2.356669 Pakistan, Asia, 196.2,310403 Peru, South America, 30.1,496226 (a) Create a class named Nation with four instance variables to hold the data for a country and a method named pop Density that calculates the population density of the country. Write a program that uses the class to create a dictionary of 193 items, where each item of the dictionary has the form name of a country: Nation object for that country Use the file UN.txt to create the dictionary, and save the dictionary in a pickled binary file named nationsDict.dat. Also, save the class Nation in a file named nation.py

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!