Answered step by step
Verified Expert Solution
Link Copied!

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 3: 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 Birth_Rate, Life_Expectancy, and GNI for all developing countries?
Would you like the average Birth_Rate, Life_Expectancy, and GNI for all developed countries?
Would you like to know which contries are considered developed?
Would you like the average Birth_Rate, Life_Expectancy, and GNI for all 10 countries?
For 1. 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:
Country_Name ---> Pakistan
Life_Exp -->>62.76
Birth_Rate --->32.04
GNI -490.0
Development ---> Developing
For 2. 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:
Congo_Dem_Rep
India
South_Africa
China
Pakistan
Mexico
For 3. and 4. could be done in a single code segment/module where a choice of 3 or 4 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 --->1813.33
Average Birth Rate --->27.82
Average Life Expectancy --->63.0
For 5. should be the opposite of 2. and the output should look the same but for contries considered developed.
For 6. the output should be similar to the one in 3 or 4 but should have values that correspond to the averages computed across all 10 countries.
IN PYTHON
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Postgresql 16 Administration Cookbook Solve Real World Database Administration Challenges With 180+ Practical Recipes And Best Practices

Authors: Gianni Ciolli ,Boriss Mejias ,Jimmy Angelakos ,Vibhor Kumar ,Simon Riggs

1st Edition

1835460585, 978-1835460580

More Books

Students also viewed these Databases questions