You will write three small functions that use the table of cation tests. One compares two cations, one names the cations that fit your results, and one decides whether the ammonia test is needed.
The idea. Each cation has two rows in the table: the effect of aqueous sodium hydroxide and the effect of aqueous ammonia. A row is a pair: the colour of the ppt. and what happens in excess. A result fits a cation when it equals that cation's row. Some results fit more than one cation, so the function lists every cation that fits.
Your tasks.
same_naoh_result(a, b). It is True when two cations give the same result with sodium hydroxide.identify(naoh, ammonia). It returns a sorted list of the cations that fit. The ammonia result may be None, which means that the test was not done.needs_ammonia(a, b). It is True when sodium hydroxide cannot tell the two cations apart, but aqueous ammonia can.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…