You will write three small functions that describe the climate of a place from its 12 monthly temperatures.
The idea. A place is polar if its warmest month is below 10 °C. Next, it is dry if it gets less than 250 mm of rain a year. Then it is tropical if its coldest month is 18 °C or more, temperate if the coldest month is 0 °C or more, and cold otherwise.
Your tasks.
yearly_mean, return the mean of the 12 temperatures in the list temps.yearly_range, return the warmest minus the coldest temperature.zone, return "polar", "dry", "tropical", "temperate" or "cold", using the rules above. The test order matters.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…