How to check for passing in Grade class?

Man, I breezed through all of Python up until this point, and this is just an insane roadblock that I’m not getting through at all ;(

Anyway, I’m having trouble using the is_passing() method. Here is my code:

class Student:
  def __init__(self, name, year): = name
    self.year = year
    self.grades = []
  def add_grade(self, grade):
    if type(grade) == Grade:
class Grade:
  minimum_passing = 65
  def __init__(self, score):
    self.score = score

  def is_passing(self):
    if self.score >= Grade.minimum_passing:
      return True
      return False

roger = Student("Roger van der Weyden", 10)
sandro = Student("Sandro Botticelli", 12)
pieter = Student("Pieter Bruegel the Elder", 8)
x = Grade(70)

When I do that, like you suggested, I get an attribute error:
AttributeError: 'Student' object has no attribute 'grade'

Any ideas? x.is_passing works fine.

6 posts were merged into an existing topic: How to check for passing in the Grade class?