human
I am working on the file "Sessions/Session03/Day2/OOP_solns.ipynb".
The first task is:
Problem 1) Create a galaxy class
We will begin our experience with object-oriented code by creating a class to represent a galaxy.  In order to do this, we must define the class, give it some default methods, and then some attributes to describe each instance of a galaxy.
Problem 1a
What do you think should be the attributes and characteristics that should be tracked for a galaxy object?  Think critically and make a list of at least six different quantities that would make sense if this were a research project.  Please do this prior to starting (or looking at) the example below. Discuss with your code partner.
Possible Answers: Mass, Luminosity, SFR, Metallicity, Color, Age, Central Black Hole Mass, Disk?, Type (Sab, E0, etc.), Spin
Problem 1b
Define a galaxy class, and give it an initializer class method.  Have your initializer accept arguments for total_mass, cold_gas_mass, and stellar_mass.  Have it also accept keyword arguments for age with a default set to 0.  Maybe also include a SFR and color in your attributes, but initialize it to 0 and 'red' respectively.  I'll include docstrings for you to help guide you along the way.
Hint: Don't forget to use self to indicate an object of this class.
Can you write Python program for it?
assistant
#Here do you think should be the attributes and characteristics that should be tracked for a galaxy object.

class Galaxy():
    """
    Galaxy class for simply representing a galaxy.
    """
    def __init__(self, total_mass, cold_gas_mass, stellar_mass, age=0):
        self.total_mass = total_mass
        self.cold_gas_mass = cold_gas_mass
        self.stellar_mass = stellar_mass
        self.age = age
        self.SFR = 0
        self.color = 'red'