SigmaQuan / Better-Python-59-Ways

Code Sample of Book "Effective Python: 59 Specific Ways to Write Better Pyton" by Brett Slatkin
1.39k stars 221 forks source link

NameError: name 'Grade' is not defined #4

Closed ghost closed 5 years ago

ghost commented 5 years ago

In item 22, I noticed there is a Grade here but didn't get what it is.

    def report_grade(self, score, weight):
        self._grades.append(Grade(score, weight))

Also, when i run the sample code, i got this error self._grades.append(Grade(score, weight)) NameError: name 'Grade' is not defined

Someone can help explaining?