You will write functions that decide which ion deposits first at a cathode, how much of it is left when the next one starts, and whether hydrogen would win. The checker tests them with new numbers.
The idea. The deposition potential of an ion is . The ion with the highest value goes first. When the second ion starts, the first ion has a concentration at which equals the starting potential of the second. Hydrogen forms at .
Your tasks.
deposition_potential(e0, n, conc) so that it returns the potential in volts.first_to_deposit(ions). The argument is a dictionary {name: (e0, n, conc)}. Return the name of the ion with the highest deposition potential.share_left(first, second). Each argument is a tuple (e0, n, conc). Return the percentage of the first ion that is left when the second ion starts to deposit.hydrogen_first(e_metal, ph, eta) so that it returns True when the working potential of hydrogen is above the deposition potential of the metal.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…