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
  • 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 pollution calculator
ChemistryMediumHigh School (9–10)Chemical Reactions

A pollution calculator

You will write four functions for the first two lessons. One finds the carbon dioxide from the complete combustion of methane. One finds the carbon monoxide if all of the methane burns incompletely. One finds the calcium oxide that a scrubber needs. One works out what a catalytic converter makes from two gas volumes.

The idea. Methane has Mr=16M_r = 16Mr​=16. Carbon dioxide has Mr=44M_r = 44Mr​=44 and carbon monoxide has Mr=28M_r = 28Mr​=28. The scrubber reaction is CaO+SO2→CaSO3\text{CaO} + \text{SO}_2 \rightarrow \text{CaSO}_3CaO+SO2​→CaSO3​, with MrM_rMr​ of 565656 and 646464. The converter reaction is 2 CO+2 NO→2 CO2+N22\,\text{CO} + 2\,\text{NO} \rightarrow 2\,\text{CO}_2 + \text{N}_22CO+2NO→2CO2​+N2​, and the gas volumes are in the ratio of the moles.

Your tasks.

  1. Complete co2_from_methane(mass), in grams.
  2. Complete co_from_methane(mass), in grams, when all of it makes carbon monoxide.
  3. Complete cao_for_so2(tonnes), in tonnes.
  4. Complete converter(co, no), which gives the pair (volume of carbon dioxide, volume of nitrogen).

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, call converter(30, 12) and converter(12, 30). Why are the two answers the same?

StemPy LabContributed by StemPy Lab
python
Loading Python runtime…

A 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 fertiliser calculatorA carbon budget →
More onChemical Reactions

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. A carbon budgetMedium
  2. The rate of rustingMedium
  3. Hot and cold reactionsEasy
  4. Will a precipitate form?Medium
  5. Which metal displaces which?Easy
All labs on this topic →