You will write three functions about the brightness of stars.
The idea. A star of magnitude looks times as bright as a star of magnitude . A brightness ratio is a difference of magnitudes. The rough rule counts the stars brighter than magnitude .
Your tasks.
times_brighter, return how many times as bright star 1 looks as star 2.magnitude_gap, return the difference of magnitude for a brightness ratio.count_brighter, return the rough number of stars brighter than 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…