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. /Carbon accounts under a cap
Earth and Environmental ScienceEasyHigh School (11–12)Pollution and Waste

Carbon accounts under a cap

You will keep the carbon accounts of four firms under a trading scheme, with three greenhouse gases, and find how much money changes hands.

The idea. A firm's emission in carbon dioxide equivalent is

E=mCO2+28 mCH4+265 mN2O\displaystyle E = m_{\text{CO}_2} + 28\,m_{\text{CH}_4} + 265\,m_{\text{N}_2\text{O}}E=mCO2​​+28mCH4​​+265mN2​O​

with each mass in tonnes. Its balance is its allowance minus EEE. A firm with a negative balance buys that many credits; a firm with a positive one can sell.

Your tasks.

  1. In co2e, return the emission of a firm in tonnes of CO₂e.
  2. In balance, return the allowance minus the CO₂e.
  3. In money_paid, return the total paid by all the firms that must buy, at the given price.

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, raise the price to 1200 rupees. Then cut the brick kiln's methane by half. Does it still have to buy credits?

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 footprint calculatorA week of filter readings →
More onPollution and Waste

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Primary and secondary pollutants, monitoring and carbon tradingAir Pollution: Sources, Control and Sampling

More labs on this topic

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