Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3 : Knowledge is Power Hopefully by now you are seeing that your skills are growing. As such, now its time to pierce into
Problem : Knowledge is Power Hopefully by now you are seeing that your skills are growing. As such, now its time to pierce into the data to see what can
be found. Write a interactive code that is capable of going through the dictionary you have built in the previous problem to provide a user with the result of the
following options. Thus you must create the interactive code to present and obtain the choice of the user. Then you must use conditionals, prints, and
computations to provide the result for each one.
HINT & ADVISE: It is advisable that you work on code for each part separate, test and assure it works. Then work on the combination all the code. I advise
that you do not start with the input part first as then as you are trying to develop the code it will prompt you for an input. Do the code for each of the options
first, then the main input.
Would you like to know the data for a particular country?
Would you like to know which contries are considered developing?
Would you like the average BirthRate, LifeExpectancy, and GNI for all developing countries?
Would you like the average BirthRate, LifeExpectancy, and GNI for all developed countries?
Would you like to know which contries are considered developed?
Would you like the average BirthRate, LifeExpectancy, and GNI for all countries?
For You will prompt the user for which county. Thus, you should print a numbered list of the country names to choose from. You can take the country name
or a number choice for an input, which is up to you to decide. Then use this input to print out the key and value pairs for the country chosen. Desired output:
CountryName Pakistan
LifeExp
BirthRate
GNI
Development Developing
For You should simply print out the countries that have "Developing" under the "Development" key in each country. The desired input should look like:
The following countries are developing:
CongoDemRep
India
SouthAfrica
China
Pakistan
Mexico
For and could be done in a single code segmentmodule where a choice of or is evaluated and will compute the average for developing and not
developing at the same time, but you should assure the code fully tested for both cases. Desired output should look like:
The averages of developing countries are:
Average GNI
Average Birth Rate
Average Life Expectancy
For should be the opposite of and the output should look the same but for contries considered developed.
For the output should be similar to the one in or but should have values that correspond to the averages computed across all countries.
IN PYTHON
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