You will write the functions that count the food chains of a web and that find the animals that nothing eats.
The idea. A web is stored as a dictionary. For each eater it lists the foods. The food chains run from the producer to an animal that nothing eats.
Your tasks.
top_animals. It returns the sorted list of the species that nothing eats.count_chains. It returns the number of food chains that start at the producer.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…