You will write three functions that turn the readings of a BOD test into a result and a judgement.
The idea. The bottle holds 300 mL. The sample is diluted in it, so the fall in dissolved oxygen is multiplied by the dilution factor. A test is valid only if the oxygen falls by at least 2.0 mg/L and at least 1.0 mg/L is left at the end.
Your tasks.
bod5(do_start, do_end, sample_ml). It returns the BOD5 in mg/L for a 300 mL bottle.valid(do_start, do_end). It returns True when the fall is at least 2.0 mg/L and at least 1.0 mg/L is left.judge(bod). It returns "clean" below 5, "polluted" from 5 up to 17, and "highly polluted" from 17 mg/L.Run your code once to unlock the worked solution.
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…