You will write functions that compare antacids by how much acid each gram takes up. Each antacid is stored with its molar mass and the number of that one formula unit takes up.
The idea. One gram holds moles of the antacid, and each mole takes up moles of acid. So the acid taken up per gram is .
Your tasks.
acid_per_gram(name): the millimoles of acid that one gram takes up, .mass_needed(name, acid_mmol): the grams of antacid that take up acid_mmol millimoles of acid.best(): the name of the antacid with the largest acid per gram.Run your code once to unlock the 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 join the discussion.
Loading…