Question: This page contains 2 0 1 7 census information when the total population of the U . S . was 3 2 5 , 7

This page contains 2017 census information when the total population of the U.S. was 325,719,178.
The file nested-lists.py contains information about the 10 most populous states.
Add a pure function to nested-lists.py that calculates and returns the total population of the information passed into it. Print this value after the function returns it.
Modify the program to also print the percentage of the U.S. population that lives in the 10 most populated states.
Modify the populations variable to include information about whether each state is landlocked. Consider a landlocked state to be one that does not touch the Atlantic Ocean, the Pacific Ocean or the Gulf of Mexico.
Modify the program to also calculate and print the percentage of the population in the 10 most populated states that live in a landlocked state.
Time permitting, make other interesting enhancements.
nested lists.py:
populations =[["California",39536653],
["Texas",28304596],
["Florida",20984400],
["New York", 19849399],
["Pennsylvania",12805537],
["Illinois",12802023],
["Ohio",11658609],
["Georgia",10429379],
["North Carolina", 10273419],
["Michigan",9962311]]

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!