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 carbon budget
ChemistryMediumHigh School (9–10)Chemical Reactions

A carbon budget

You will write four functions for the lesson on climate. One finds the glucose that a plant makes from a mass of carbon dioxide. One finds the volume of oxygen it gives out. One finds the carbon dioxide from burning petrol, which we treat as octane. One finds how many trees take up that carbon dioxide in a year.

The idea. Photosynthesis is 6 CO2+6 H2O→C6H12O6+6 O26\,\text{CO}_2 + 6\,\text{H}_2\text{O} \rightarrow \text{C}_6\text{H}_{12}\text{O}_6 + 6\,\text{O}_26CO2​+6H2​O→C6​H12​O6​+6O2​. Octane has Mr=114M_r = 114Mr​=114, burns by 2 C8H18+25 O2→16 CO2+18 H2O2\,\text{C}_8\text{H}_{18} + 25\,\text{O}_2 \rightarrow 16\,\text{CO}_2 + 18\,\text{H}_2\text{O}2C8​H18​+25O2​→16CO2​+18H2​O and one dm³ of petrol has a mass of 700 g700\ \text{g}700 g.

Your tasks.

  1. Complete glucose_from_co2(mass), in grams.
  2. Complete oxygen_volume(mass), in dm³ at r.t.p.
  3. Complete co2_from_petrol(litres), in kg.
  4. Complete trees_needed(litres, per_tree), where per_tree is the kg of carbon dioxide that one tree takes up in a year.

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 trees_needed(40, 20). Does your answer agree with the problem about a tank of petrol?

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 pollution calculatorA repeat unit calculator →
More onChemical Reactions

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. A pollution calculatorMedium
  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 →