You will write three short functions that work out crude rates and use them to compare towns.
The idea. A crude rate is , per thousand of the population. A rate per thousand becomes a rate per when you multiply it by 100.
Your tasks.
crude_rate(events, population). Return the rate per thousand.per_hundred_thousand(rate). Return the same rate per people.highest(names, events, populations). Return the name of the town with the highest crude 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…