Each salt is written as a pair: its metal and its group, such as ("Ba", "Cl") for barium chloride. When two salt solutions are mixed, the partners swap. You will write the swap, check the new pairs against a short list of solids that do not dissolve, and count the mixtures that give a precipitate.
The idea. In a double displacement, AB + CD gives AD + CB. If AD or CB does not dissolve in water, it comes out as a precipitate.
Your tasks.
swap, return the two new pairs, (a[0], b[1]) and (b[0], a[1]).precipitate, return the new pair that is in insoluble, or None.n_precip, the mixtures in mixtures that give a precipitate.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 and 1 Python lab. Everything you have used here stays free, always.