You will write three small functions to study a record of carbon dioxide: the rate of rise between two readings, the percentage rise, and the time to reach a target level.
The idea. The average rate of rise is the rise divided by the years. A percentage rise is the rise divided by the old value, times . If the rate stays the same, the time to reach a target is the rise still needed divided by the rate.
Your tasks.
rate, return the average rise in ppm a year between two readings years apart.percent_rise, return the percentage rise from old to new.years_to_reach, return how many years a level level needs to reach target at a steady rate.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…