Six metals are listed in the order of the reactivity series, the most reactive first. You will write a function that says whether one metal displaces another from its salt, count how many each metal displaces, and find the metals that displace none.
The idea. A metal displaces another from its salt solution only if it is higher in the series, which here means earlier in the list.
Your tasks.
displaces, return True when metal comes before other in series.table with how many of the other metals each metal displaces.never, the list of metals that displace none of the others.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.