x0 = 0 y0 = 0 x1 = 4 y1 = 3 class Distances(): def pythagorean (self, x0, y0, x1, y1): diff_x, diff_y = self.difference (x0, y0, x1, y1) diff_x_squared = diff_x * diff_x diff_y_squared = diff_y * diff_y distance = (diff_y_squared + diff_x_squared) ** 0.5 return distance def difference(self, x0, y0, x1, y1): return (x0 - x1), (Y0 - y1) dis = Distances() answer = dis.pythagorean(x0, y0, x1, y1) print(answer)