Let's take the following example of Student class:
courses1 = ['python', 'java', 'javascript']
courses2 = ['java', 'rails', 'c']
dmitri = Student("dmitri", "telinov", courses1)
dmitri_doubled = Student("dmitri", "telinov", courses2)
Since dmitri and dmitri_doubled have the same first name and last name, you want them to be equal. In other words, you want the following expression to return True:
dmitri == dmitri_doubled
To do it, you can implement the __eq__ dunder method in the Student class. def __eq__(self, other):
return self.first_name == other.first_name \
and self.last_name == other.last_name
So the output of the:
print(dmitri == dmitri_doubled)
will be:
True