A computer can balance an equation by trying small whole numbers in front of each formula, smallest first, until the atoms match. You will write the counting, the search, and then use it on propane.
The idea. A coefficient multiplies every atom in its formula. An equation is balanced when each element has the same count on both sides.
Your tasks.
side_total, add c * n to total[element] for every atom of every formula.balance, return a, b as soon as the two sides have equal totals.oxygen_coef, the number in front of when propane burns: .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 6 more problems, 1 Python lab and 1 extra course. Everything you have used here stays free, always.