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. /Pollution numbers in code
Earth and Environmental ScienceMediumHigh School (9–10)Pollution and Waste

Pollution numbers in code

You will write three functions that a pollution control board might use: the sulfur dioxide that leaves a chimney, the cut in dust that a city needs, and the number of stations that fail a standard.

The idea. Each tonne of sulfur makes 2 t2\ \text{t}2 t of sulfur dioxide, and a scrubber that removes removal percent lets the rest through. The cut needed from a level ccc to a limit LLL is (c−L)/c×100(c - L)/c \times 100(c−L)/c×100 percent, or 000 if the level already meets the limit.

Your tasks.

  1. In so2_released, return the tonnes of sulfur dioxide released from coal tonnes with sulfur percent sulfur and a scrubber that removes removal percent.
  2. In cut_needed, return the percentage cut from level c to limit, or 0 if c is not above the limit.
  3. In failing, return how many readings in the list readings are above limit.

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, find the sulfur dioxide from 12 000 t12\,000\ \text{t}12000 t of coal with 0.9 %0.9\ \%0.9 % sulfur and a scrubber that removes 96 %96\ \%96 %.

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
← Feedback, albedo and plant zones in codeHabitat and forest numbers in code →
More onPollution and Waste

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Controlling pollution: laws, treaties and actionThe Triple Planetary Crisis and Pollution Control

More labs on this topic

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