You will write three small functions about the brightness of stars.
The idea. For two stars of equal luminosity, . A step of magnitudes is a factor of in brightness. The distance modulus is , with in parsecs.
Your tasks.
brightness_ratio, return for two stars of equal luminosity at distances d1 and d2.magnitude_ratio, return how many times brighter a star is that is dm magnitudes brighter than another.distance_pc, return the distance in parsecs from the apparent magnitude m and the absolute magnitude M.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…