You will build a small calculator: a function that finds the molar mass of a formula written as a list of (symbol, number of atoms), a function for the percentage of one element, and a search for the heaviest of five substances.
The idea. Molar mass = the sum of (number of atoms × atomic mass). The share of an element = its mass in the formula ÷ the molar mass × .
Your tasks.
molar_mass, add n * atomic[symbol] for every part of the formula.percent, return the percentage of element in the formula.heaviest, the name of the substance with the largest molar mass.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…
With Standard, you also open 9 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.