You will write three small functions that plan a scale model of the Solar System.
The idea. In a scale model every width shrinks by the same amount as the Sun: model width = real width × model Sun ÷ real Sun. The real Sun is wide. Distances work the same way: model distance = distance in AU × the model length of 1 AU.
Your tasks.
model_width, return the model width in mm of a body real_km wide, when the model Sun is sun_mm wide.model_distance, return the model distance in m of a planet au AU away, when 1 AU is au_m metres.count_fit, return how many planets of the dictionary distances have a model distance of length m or less.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…