human
I am working on the file "Sessions/Session03/Day2/OOP_solns.ipynb".
The first task is:
Problem 1d
So Python probably didn't do a very good internal representation of your galaxy.  Remember, classes have a few built-in class methods to be defined.  One is the __init__ method, so that we know how to initialize the class.  Another very useful class method is the __repr__, which tells us how to represent a class object when we try to print it out.  It's very useful for debugging.  Please copy your class definition from above, and add the __repr__ method to return a string somehow identifying a galaxy based on its attributes.  Now recreate your favorite galaxy, and print ut out again and see if it is a bit more readable than before.
Can you write Python program for it?
 ... Write me a Python program to print it out?
assistant
#Here is Python program to print it out.

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'
        
    def __repr__(self):
        return "Galaxy (m_total = %.1g; m_cold = %.1g; m_stars = %.1g; age = %.1g; SFR = %0.2f)" % \
                (self.total_mass, self.cold_gas_mass, self.stellar_mass, self.age, self.SFR)

milky_way = Galaxy(1e12, 1e8, 1e10, age=5e9)
print(milky_way)