You will write three small functions that apply the principle of moments.
The idea. The moment of a force is the force times its distance from the pivot. A beam balances when the total moment on the left equals the total moment on the right. A load is a pair (force, distance).
Your tasks.
moment, return the moment of one load.total_moment, return the total moment of a list of loads.balanced, return True if the totals of the two lists differ by no more than tolerance times the bigger one.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…