Each formula is given as a list of its ions: (charge, how many). You will add up the charges, list the formulas that are neutral, and catch the one that a careless student wrote wrongly.
The idea. In a real ionic compound, the positive and negative charges cancel, so the total is zero.
Your tasks.
total_charge, return the sum of charge × number for all the ions.neutral with the names of the formulas whose total is zero.wrong, the name of the formula that is not neutral.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 5 more problems and 2 Python labs. Everything you have used here stays free, always.