You will write functions that count the isomers of a formula , and decide which route to an ether is better.
The idea. An ether is a pair of alkyl groups. The number of alkyl groups with 1 to 6 carbons is 1, 1, 2, 4, 8 and 17. An ether with carbons has two groups of and carbons, with . Two pairs that differ only in order are the same ether. In a Williamson synthesis the halide should be the less crowded one.
Your tasks.
count_ethers(n) so that it counts the ethers, using the table alkyl.count_isomers(n) so that it adds the alcohols to the ethers.better_route(halide_a, halide_b) so that it returns "a" or "b", whichever route uses the less hindered halide.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…