HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Python Labs
  2. /A BOD bottle
ChemistryMediumHigh School (11–12)Environmental Chemistry

A BOD bottle

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.

  1. Complete bod5(do_start, do_end, sample_ml). It returns the BOD5 in mg/L for a 300 mL bottle.
  2. Complete 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.
  3. Complete judge(bod). It returns "clean" below 5, "polluted" from 5 up to 17, and "highly polluted" from 17 mg/L.

Run it first, just as it is. The checker at the end prints FAIL for each task. Then do the tasks one at a time, and run the program again after each one. A Hint appears under every check that still fails.

When every line says PASS, try a sample of 100 mL with readings of 8.8 and 0.4 mg/L. Is the test valid? What would you change?

StemPy LabContributed by StemPy Lab
python
Loading Python runtime…

A worked solution

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 save
← All Labs
← Carbon dioxide equivalentsAn atom economy calculator →
More onEnvironmental Chemistry

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. Nanoparticles by the gramMedium
  2. An atom economy calculatorMedium
  3. Carbon dioxide equivalentsEasy
  4. Photons and the ozone shieldMedium
  5. Air monitor readingsEasy
All labs on this topic →