A dictionary holds the eight infections of the NCERT list, with their cause and what the lesson says about their cure and their spread. You will sort and count them.
The idea. A dictionary can be searched with a loop or a list comprehension, and the answers can be counted.
Your tasks.
count_by_type. It gives a dictionary with the number of infections of each cause.not_curable. It gives the sorted list of the names of the infections that are not completely curable.needle_spread. It gives how many infections can also spread on shared needles.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…