Question: Part I: Estimating the U.S. Population (4 points) The webcomic xked gives the following formula to approximate the United States population for a given year
Part I: Estimating the U.S. Population (4 points) The webcomic xked gives the following formula to approximate the United States population for a given year (from 2000 onward): 1. Obtain the last two digits of the year (for example, 2017 would give you 17). One way to do this is to calculate the year modulo 100 2. Subtract 10 from this value 3. Multiply the result by3 4. Add 310 to the product from the previous step This gives the approximate U.S. population in millions of people For example, consider the year 2006. The last two digits of 2006 are 06, or just 6. Subtracting 10 gives us -4. Multiplying-4 by 3 gives us-12. Finally, we add 310 to -12 to get our final answer: 298 (million people) The probleml.py" tile contains a Python function named population (). which takes a single argument: a positive integer greater than or equal to 2000, representing a four-digit year (you may assume that this value will never be larger than 2045). Complete the definition of this function so that it calculates and returns an integer corresponding to the estimated U.S. population for that year in millions Examples: Function CallReturn Value (200 tion
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
