You will write three functions for a simple pendulum.
The idea. For small swings, . To find the length for a chosen period, square it: . In a lift with acceleration , upwards positive, the bob feels .
Your tasks.
period, return in s for a length in m and gravity in m/s².length_for, return the length in m that gives the period .period_in_lift, return the period in a lift. If is zero or less, return None, because the bob does not swing.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…