You will write functions that decide which functional group a compound has from the set of its positive tests. The tests are named by short strings, such as "DNP" for 2,4-dinitrophenylhydrazine.
The idea. A positive 2,4-DNP test shows a carbonyl compound. If Tollens' reagent is also positive, it is an aldehyde. If sodium hydrogencarbonate gives effervescence, the compound is a carboxylic acid. A violet colour with neutral iron(III) chloride shows a phenol.
Your tasks.
carbonyl_type(tests). It returns "aldehyde", "ketone" or None.acid_or_phenol(tests). It returns "carboxylic acid" when "NaHCO3" is in the set, "phenol" when "FeCl3" is in it, and None otherwise.group(tests). It returns the carbonyl type if there is one, else the answer of task 2, else "unknown".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…