Introduction to classes | Review

Click here for the excersice
I am on step 3 and I was randomly hit with “maximum recursion depth exceeded while calling a Python object” I am not sure how to get around this, it doesn’t make sense I don’t get how this simple code could exceed the maximum recursion depth.

class Student:
  def __init__(self, name, year):
    #Instance variables = name
    self.year = year
    #Class instances
    roger = Student("Roger van der Weyden", 10)
    sandro = Student("Sandro Botticelli", 12)
    pieter = Student("Pieter Bruegel the Elder", 8)

Be sure to declare instances outside of the class definition (without any indentation).

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.