You will write three small functions. They find the orbital speed of a planet from its orbit, name the fastest planet, and test whether the speed falls as the radius grows.
The idea. For a nearly circular orbit, . Use the radius in millions of km and the period in days. Then in km/s is .
Your tasks.
orbital_speed, return the speed in km/s for a radius radius_mkm and a period days.fastest, return the name of the planet in data with the greatest speed.falls_outwards, return True if the speed gets smaller for every planet farther from the Sun, with the planets listed in order of radius, and False if not.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…