A class has listed the things in its dustbin. You will write a function that says whether an item breaks down, sort the list into two, and find what share of the items breaks down.
The idea. An item is biodegradable if it is in the set BIODEGRADABLE. Keep the items in the order of the list.
Your tasks.
is_biodegradable, return True if the item is in BIODEGRADABLE, else False.breaks_down to the items that are biodegradable.stays to the items that are not.percent to the percentage of the items that break down, 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…