> masteringswe_
codingpython

Override eq

Add a method to class Point so that == compares two Point objects based on their x and y values. (point1 == point2 if point1.x == point2.x and point1.y == point2.y )

pythonclass Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y
        

p1 = Point(1, 2)
p2 = Point(1, 2)

print(p1 == p2)  # Should print True after the class is fixed