You will write three small functions that sort bodies of the Solar System and place them.
The idea. A planet goes round the Sun, is round and has cleared its orbit. A dwarf planet goes round the Sun and is round, but has not cleared its orbit. Anything else is not a planet. One AU is 149.6 million km, and Neptune is 30.1 AU from the Sun.
Your tasks.
classify, return "planet", "dwarf planet" or "not a planet", using the three rules.to_million_km, return a distance in AU changed into million km.closer_than_neptune, return True if a distance in AU is less than Neptune's 30.1 AU, and False if it is not.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…