You will write three functions for protecting habitats: the share of species that a smaller habitat keeps, the share of a district under forest, and the forest it still needs for the goal of one third.
The idea. A habitat cut to a share keeps of its species. The forest share is forest area . The forest needed is one third of the area minus the forest, or if the goal is met.
Your tasks.
species_kept, return the share of species kept, as a number from 0 to 1, for a share a of the habitat and an exponent z.forest_share, return the percentage of the area that is forest.more_forest, return the square kilometres of forest still needed for one third, or 0 if the goal is met.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…