# You wrote:
def add_grade(self, grade):
if type(grade) is Grade:
self.grades.append(grade)
else:
pass
When you make the calls
pieter.add_grade(Grade(100))
# and so on...
you are passing an instance of the Grade class as the argument to add_grade. Within add_grade, you are appending this object to self.grades. Therefire, the output of your print statement print(pieter.grades) is a list of Grade objects.
If your intention is not to append the Grade objects but the actual scores, then you can amend your add_grade to:
# You wrote:
if type(grade) is Grade:
self.grades.append(grade)
# Change to:
if type(grade) is Grade:
self.grades.append(grade.score)
Once you make the above change, your output will be:
print(pieter.grades)
# [100, 98, 64, 97]
However, if your intention is to append the Grade object and then extract the score later, then you should see the suggestions in this post: