You will write three small functions about electric charge.
The idea. Like charges repel and unlike charges attract. When a rod is rubbed with a cloth, electrons move from one to the other, and the total charge stays zero. Two identical metal spheres that touch share their total charge equally. Charges are in nC.
Your tasks.
force_type, return "repel" if the two charges have the same sign, "attract" if the signs are different, and "none" if either charge is zero.after_rubbing, return the pair (rod, cloth) of charges in nC when the rod gains electrons electrons. One electron has the charge C.share, return the charge on each of two identical metal spheres that carry a and b and touch.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…