You will write three small functions for the orbit of a star round the Galaxy. Distances are in light-years and speeds are in km/s.
The idea. One lap of a circle takes . The mass inside the orbit is . The number of laps in a given time is the time divided by the period.
Your tasks.
period_myr, return the period in millions of years.enclosed_mass, return the mass inside the orbit in billions of solar masses.laps, return the number of laps in age_gyr billion years, given the period in millions of years.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…