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
  • Computer 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 hydrated salt calculator
ChemistryEasyHigh School (9–10)Equilibrium › Chemical Equilibrium

A hydrated salt calculator

You will write three functions for crystals that hold water of crystallisation. One finds the relative formula mass of the crystals. One finds the percentage of water. One finds the mass of powder left after heating.

The idea. The relative formula mass of the crystals is the relative formula mass of the anhydrous salt plus 181818 for each molecule of water. The share of water is the mass of water divided by the mass of the crystals.

Your tasks.

  1. Complete mr_hydrate(mr_anhydrous, n_water).
  2. Complete percent_water(mr_anhydrous, n_water).
  3. Complete mass_after_heating(mass, mr_anhydrous, n_water). It returns the mass of anhydrous powder left from mass grams of crystals.

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 percent_water(120, 7) for magnesium sulfate crystals. Is more than half of the crystal water?

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
← From times to ratesA reversible reaction simulator →
More onEquilibrium › Chemical Equilibrium

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Reversible reactions and the two-way arrowReversible Reactions and Equilibrium

More labs on this topic

  1. A reversible reaction simulatorMedium
  2. A disturbed equilibriumMedium
  3. K, Q and the direction of changeEasy
All labs on this topic →