A school has counted the pupils in each class and how many are vaccinated. You will find the cover of each class, then of the whole school, and list the classes that fall short.
The idea. Each class has a pair: the number of pupils and the number of vaccinated pupils. A class is short if fewer than % of its pupils are vaccinated.
Your tasks.
cover, return the percentage of pupils vaccinated, to one decimal place.total and vaccinated to the totals for the whole school.school_cover to the cover for the whole school, using your function.short to the names of the classes whose cover is below %, in the order of the dictionary.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…