human
I am working on the file "Classes.ipynb".
The first task is:
Next up we define a method to add two points. Addition is by elements - $(x_1, y_1) + (x_2, y_2) = (x_1+x_2, y_1+y_2)$.
We also allow to add an int, in which case we add the point to a another point with both coordinates equal to the argument value.
Can you write Python program for it?

Write me a the Python program you requested?
assistant
#Here is the Python program you requested.

class Point():
    """Holds on a point (x,y) in the plane"""
    def __init__(self, x=0, y=0):
        assert isinstance(x, (int, float)) and isinstance(y, (int, float))
        self.x = float(x)
        self.y = float(y)
    def __repr__(self):
        return "Point(" + str(self.x) + ", " + str(self.y) + ")"
    
    def add(self, other):
        assert isinstance(other, (int, Point))
        if isinstance(other, Point):
            return Point(self.x + other.x , self.y + other.y)
        else: # other is int, taken as (int, int)
            return Point(self.x + other , self.y + other)

Point(1,1).add(Point(2,2))

Point(1,1).add(2)