You will write three functions. One gives the residence time of a pool. One gives the net change of the soil phosphate of a field. One gives the years until a pool is used up.
The idea. The residence time is the pool divided by the flow out of it each year. The net change of a pool is what comes in minus what goes out. A pool that loses a fixed amount each year is used up in the pool divided by the loss.
Your tasks.
residence_time. It gives the years.net_change. It gives the units a year, from the weathering, the returned phosphate, the uptake and the runoff.years_until_empty. It gives the years until a pool is used up, or None if the pool does not fall.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…