You will write three small functions that read the results of the tests on a sodium fusion extract. The results are stored in a dictionary. A test that was done and positive is True.
The idea. Nitrogen shows as Prussian blue or as the blood red colour of thiocyanate. Sulphur shows as the violet nitroprusside colour, as a black lead sulphide precipitate, or as thiocyanate. A halogen shows as a silver halide with a colour that names it.
Your tasks.
has_nitrogen(r). It returns True when Prussian blue or the blood red colour is positive.has_sulphur(r). It returns True when the violet colour, the black precipitate or the blood red colour is positive.halogen(r). It looks up the colour of the silver halide in the table HALOGEN and returns the name, or None if there was no precipitate.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…