符合条件的代码怎样编写?

img

class Point:
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y
    def distance(self, p):
        return round(((self.x - p.x) ** 2 + (self.y - p.y) ** 2) ** 0.5, 2)
    
    def isNearBy(self, p1):
        return self.distance(p1) < 5
    
    def __str__(self):
        return f"({self.x:.2f},{self.y:.2f})"
        

n1, n2, n3, n4 = eval(input(">>>"))

p1 = Point(n1, n2)
p2 = Point(n3, n4)
print(p1, p2)
dis = p1.distance(p2)
print("The distance between the two points is {}".format(dis))

res = p1.isNearBy(p2)
if res:
    print("The two points are near each other.")
else:
    print("The two points are near each other.")