self.grades = 
When I use the
add_grade method as defined below
def add_grade(self, grade): if type(grade) is Grade: self.grades.append(grade)
and then print out Pieter’s grades list
I see that Grade(100) has been appended to the list, rather than 100, the integer. I get a result of
[<__main__.Grade object at 0x7f6ace7406a0>] when printed out.
How might the
add_grade method yield integers into Pieter’s grades list?
If I enter
pieter.add_grade(100), it doesn’t satisfy the method because the integer 100 is not of class Grade.
Would I have to add a
grade argument into the constructor and then simply append
self.grade into the
self.grades list? I’m just not sure what solution the exercise wants me to find… A list with content such as
[<__main__.Grade object at 0x7f6ace7406a0>] does not strike me as useful.
This is in reference to parts 7 + 8 of the exercise.