A dictionary holds the kind of pathogen and the way of spreading for ten diseases. You will look up a disease, list the diseases of one route, and count the diseases of each kind.
The idea. A dictionary maps a name to a value. Use the disease name as the key.
Your tasks.
kind_of. It gives the kind of pathogen of a disease.diseases_by. It gives the sorted list of diseases that spread by a route.count_kinds. It gives a dictionary that counts the diseases of each kind.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…