Question
Question 12. Create a table called pop_by_decade with two columns called decade and population. It has a row for each year since 1960 that starts
Question 12. Create a table called pop_by_decade with two columns called decade and population. It has a row for each year since 1960 that starts a decade. The population column contains the total population of all countries included in the result of stats_for_year(year) for the first year of the decade. For example, 1960 is the first year of the 1960's decade. You should see that these countries contain most of the world's population.
Hint: One approach is to define a function pop_for_year that computes this total population, then apply it to the decade column. The stats_for_year function from the previous question may be useful here.
Note: The pop_by_decade cell is directly below the cell containing the helper function pop_for_year. This is where you will generate the pop_by_decade table!
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