You will write three functions that turn a news claim about risk into plain numbers: the risk per 1000 people, the relative change and the number of extra cases.
The idea. A risk of 6 cases among 2000 people is 3 per 1000. A change from 3 to 4 per 1000 is a relative rise of , but an absolute rise of only 1 per 1000.
Your tasks.
per_1000(cases, people). Return the risk as cases per 1000 people.relative_change(old, new). Return the change as a percentage of the old risk.extra_cases(old, new, population). The risks are per 1000. Return the number of extra cases in the whole population.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…