You will write three functions for the cleavage of ethers. Each group on the oxygen is one of "methyl", "primary", "secondary", "tertiary" or "aryl".
The idea. An aryl group never becomes the iodide. A tertiary group does, when there is one. Otherwise the less crowded group becomes the iodide. With excess HI the alcohol that comes off is converted as well, except for a phenol.
Your tasks.
iodide_group(first, second) so that it returns the group that becomes the alkyl iodide.hi_used(first, second) so that it returns the moles of HI that one mole of the ether uses with excess HI: 2 for two alkyl groups, and 1 when one group is aryl.count_phenols(ethers) so that it returns how many of the ethers in a list give a phenol.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…