A class has made a table of diseases, the group of microbes that cause each, and how it spreads. You will write a function to look up the group, then list some diseases, count some, and find a percentage.
The idea. Each disease is a key in the dictionary diseases. Its value is a pair: the agent ("virus", "bacterium", "protozoan" or "fungus") and the route ("air", "water", "vector" or "contact"). Keep the diseases in the order of the dictionary.
Your tasks.
agent_of, return the agent of the disease.bacterial to the list of diseases that are caused by a bacterium.water_borne to the number of diseases that spread by water.antibiotic_share to the percentage of the diseases that antibiotics can treat, rounded to a whole number.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…