You will write three small functions about a star on the main sequence. Masses and luminosities are in solar units.
The idea. The luminosity is about . The lifetime is about billion years . A star below solar masses ends as a white dwarf, and a heavier star explodes as a supernova.
Your tasks.
luminosity, return .lifetime_gyr, return the lifetime in billions of years.end_state, return "white dwarf" for a mass below and "supernova" 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…