You will finish a program that predicts the mix of monohalogen products from the number of hydrogen atoms at each position and the reactivity of each kind of hydrogen. The molecule is 2-methylbutane.
The idea. A product is formed in proportion to the number of hydrogen atoms at that position times the reactivity of one of them. The shares add to 100 percent.
Your tasks.
shares(counts, reactivity) so that it returns a dictionary of percentages, one for each product.major to the name of the main product for chlorination.bromo_tertiary to the percentage of the tertiary product when bromine is used.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…