I have the class planets that stores in a dictionary Key which is the name of the planet, and value which is the size of the planet, and then add all the values in the dictionary and print it
this is my class
class planets:
def store(self, name, mass):
aDict[self.name] = self.mass
def add(self):
return sum(aDict.values())
planets.store("Sun",50)
planets.store("Mercury",7)
print(planets.add())
I am expecting to get an answer of 57, however I am getting an error which is:
TypeError: store() missing 1 required positional argument: 'mass'
How to fix that problem?