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 ppt. calculator for the halide test
ChemistryEasyHigh School (9–10)Principles Related to Practical Chemistry

A ppt. calculator for the halide test

You will write three small functions for the silver nitrate test. One names a halide from the colour of the ppt. One finds the mass of ppt. from a volume of silver nitrate. One finds the concentration of a solution from the mass of its ppt.

The idea. Chloride gives a white ppt., bromide a cream ppt. and iodide a yellow ppt. with acidified silver nitrate. One silver ion makes one formula unit of ppt., so moles of ppt. =concentration×volume in cm31000= \dfrac{\text{concentration} \times \text{volume in cm}^3}{1000}=1000concentration×volume in cm3​ and mass === moles ×\times× formula mass.

Your tasks.

  1. Complete halide_from_ppt(colour). It returns the name of the anion, or the text "not a halide".
  2. Complete ppt_mass(conc, volume_cm3, formula_mass). It returns the mass in grams.
  3. Complete concentration_from_ppt(mass, formula_mass, volume_cm3). It returns the concentration in mol/dm3\text{mol/dm}^3mol/dm3.

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 ppt_mass(0.050, 20.0, 143.5). How does it compare with the 20 cm³ value on the simulation?

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 cation identifierA water checker →
More onPrinciples Related to Practical Chemistry

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. A cation identifierMedium
  2. A titration calculatorMedium
  3. An error calculator for apparatusEasy
  4. Purity of Mohr's saltMedium
  5. Titration readingsEasy
All labs on this topic →