You will write a small program that decides what a reagent does to a molecule that has several groups. It also counts the hydride ions that a reduction needs.
The idea. Each reagent reduces a fixed set of groups. A molecule is a list of its groups. The reagent reduces the groups that it can, and leaves the others.
Your tasks.
reduced(reagent, molecule) so that it returns the groups of the molecule that the reagent reduces.left_alone(reagent, molecule) so that it returns the groups that the reagent leaves.hydrides(molecule) so that it adds up the hydride ions needed: ketone 1, aldehyde 1, ester 2.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…