You will write three small functions about charge, electrons and touching spheres. They use .
The idea. One electron has a charge of C. A body that gains electrons has a negative charge. Identical metal spheres that touch share the total charge equally.
Your tasks.
charge_of, return the charge in C of a body that has gained electrons electrons. The answer is negative.is_possible, return True when a charge in C is a whole number of electron charges, and False when it is not. Allow a small rounding error.after_touch, charges is a list of the charges of identical spheres that all touch and are pulled apart. Return the charge that each sphere now holds.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…