You will write the tools that start every reaction scheme: the degree of unsaturation and the change of formula from one compound to the next.
The idea. . A change of formula such as losing two hydrogen atoms points to a kind of reaction (here, oxidation of an alcohol).
Your tasks.
dbe(c, h, n=0, x=0).maybe_benzene(c, h, n=0, x=0): True when there are at least 6 carbons and is at least 4.change(f1, f2): a dictionary of the elements whose counts differ, with the count in f2 minus the count in f1. The helper parse reads a formula.Run your code once to unlock the worked solution.
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…