Shine on!

Report a typo

Below you can see a class Star. There are varieties of stars based on their luminosity, temperature and other parameters. One of the types of stars is a yellow dwarf, which is what our Sun is.

Create a child class for Star and call it YellowDwarf. You don't need to create any methods for the class or any objects of the class, just the class itself.

Write a program in Python 3
class Star:
def __init__(self, name, spectral_class):
self.name = name
self.spectral_class = spectral_class

# create a child class here
___

Create a free account to access the full topic