You will finish a program with three functions. The first works out the molar mass of a polyhalogen compound from its formula. The second finds the percentage of one element in it. The third finds the mass of ozone destroyed by the chlorine of a CFC.
The idea. The molar mass is the sum of the atomic masses. The percentage of an element is its mass in one mole divided by the molar mass. A chlorine atom that is regenerated destroys many ozone molecules.
Your tasks.
molar_mass(formula), where the formula is a dictionary such as {"C": 1, "H": 1, "Cl": 3}.percent(element, formula).ozone_tonnes(kg, cl_per_molecule, chain): the tonnes of ozone destroyed by kg kilograms of a CFC of molar mass 121.0 g/mol.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 join the discussion.
Loading…