Question
Using Python. Design and implement a class Country that stores the name of the country, its population, area, and population density (i.e. Population/Density). Then write
Using Python. Design and implement a class Country that stores the name of the country, its population, area, and population density (i.e. Population/Density). Then write a python program that reads data from a text file and prints, country with largest population, country with largest density, country with largest population density (it should calculate it). You should create two python files. First, a Country class file and the second is the program that leverages the methods from Country classand prints largest countries within the categories. You might use set() to store country information and do the operations. In your text file, attributes should follow the order, Country, Population, Area. Use the datafile, https://files.fm/u/2rx4kmn8 Example output should look like, Largest Population: China Largest Area: Canada Largest Population Density: China
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started