Class constructor can have attributes that are not declared?

Hi everyone
So I am struggling a bit with the whole class concept but I am getting there step by step.
I am now at the review section for the Class study and there’s something that I am confused about.
I’ve created a constructor for Student class and have passed in 2 arguments. However, the exercise then told me to declare a:
self.grades = inside of the function

class Student:

  def __init__(self,name,year):
    self.name = name
    self.year = year
    self.grades = []

I was hoping to get an explanation on how that would work? can I still access this attribute even though I did not declare it?

Short answer, yes, it can be accessed just as the others can be.