import math class Point: def __init__(self,x=0,y=0): self.x=x self.y=y class Line(Point): def getLen(self,p1,p2): r=math.sqrt(((p1.x-p2.x)**2)+(p1.y-p2.y)**2) return r p1=Point(1,1) p2=Point(4,5) l=Line() hh=l.getLen(p1,p2) print(hh)
import math class Point: def __init__(self,x=0,y=0): self.x=x self.y=y class Line(Point): def getLen(self,p1,p2): r=math.sqrt(((p1.x-p2.x)**2)+(p1.y-p2.y)**2) return r p1=Point(1,1) p2=Point(4,5) l=Line() hh=l.getLen(p1,p2) print(hh)