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 →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental 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 report card for well water
Earth and Environmental ScienceMediumHigh School (11–12)Pollution and Waste

A report card for well water

You will check three wells against the acceptable limits for drinking water of IS 10500, and say which ones are fit to drink.

The idea. Hardness, as mg/L of calcium carbonate, is 2.497×[Ca]+4.118×[Mg]2.497 \times [\text{Ca}] + 4.118 \times [\text{Mg}]2.497×[Ca]+4.118×[Mg]. A well fails an indicator if its value is above the limit, or if its pH is outside 6.56.56.5 to 8.58.58.5.

Your tasks.

  1. In hardness, return the hardness of a well.
  2. In failures, return a list of the names of the indicators that the well fails, in the order of limits, with "pH" first if the pH is out of range. Use hardness(well) for "hardness".
  3. In fit_to_drink, return True if the well fails nothing.

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, boil the water of the old well in your mind: boiling kills germs. Set its coliforms to 0. Is it fit to drink now?

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
← A week of filter readingsReadings of a ring infiltrometer →
More onPollution and Waste

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Testing water: quality indicators, BOD and CODAir Quality Standards, Water and Soil Testing

More labs on this topic

  1. A week of filter readingsMedium
  2. Carbon accounts under a capEasy
  3. Sorting a ward's wasteEasy
  4. Pollution numbers in codeMedium
Feedback, albedo and plant zones in codeEasy
All labs on this topic →