You will write three small functions that measure with shadows and find local noon.
The idea. At one moment every upright object has the same shadow ratio, shadow ÷ height. So height = stick height × shadow ÷ stick shadow. Through the day, the shortest shadow comes at local noon.
Your tasks.
shadow_ratio, return the stick's shadow divided by its height.height_from_shadow, return the height of an object from the stick's height, the stick's shadow and the object's shadow.noon_reading, the dictionary readings holds clock times and shadow lengths. Return the time with the shortest shadow.Run your code once to unlock the worked solution.
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…