You will write three small functions about binary stars and the cores of dead stars.
The idea. The total mass of a binary is in solar masses, with in AU and in years. The Doppler shift gives the speed, , with . A core of less than solar masses becomes a neutron star, and a heavier one a black hole.
Your tasks.
total_mass, return the total mass of the binary.speed_kms, return the speed in km/s from the shift and the wavelength in the same unit.remnant, return "neutron star" for a core below solar masses and "black hole" otherwise.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…