A population grows by the same share every year. You will write the growth, count the years to doubling in a loop, and compare the answer with the rule of 70.
The idea. Each year the population is multiplied by . The doubling time is the number of years until the population is at least twice the start.
Your tasks.
population. It gives the population after years.years_to_double. It counts the years in a loop until the population is at least twice the start.rule_of_70. It gives divided by the rate.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…