Thank you! />

#Python# class distanceFormula(): def __init__(self, x2, x1, y2, y1, d = '0'): self._x1 = x1 self._x2 = x2 self._y1 = y1 self._y2 = y2 self._d = d def displayFormula(self): print('Distance Formula:') print(' d = ((x2 - x1)^2 + (y2 - y1)^2)^1/2 \n') def execFormula(self): print('d = (({} - {})^2 + ({} - {})^2)^1/2'.format(self._x2, self._x1, self._y2, self._y1)) x = self._x2 - self._x1 y = self._y2 - self._y1 print('d = (({})^2 + ({})^2)^1/2'.format(x, y)) x = x ** 2 y = y ** 2 print('d = ({} + {})^1/2'.format(x, y)) self._d = x + y print('d = ({})^1/2'.format(self._d)) self._d = self._d ** .5 print('d = {}'.format(self._d)) def resultFormula(self): return self._d def main(): x2 = int((input('Enter a value for x2: '))) x1 = int((input('Enter a value for x1: '))) y1 = int((input('Enter a value for y2: '))) y2 = int((input('Enter a value for y1: '))) print('') f = distanceFormula(x2, x1, y2, y1) f.displayFormula() f.execFormula() print('') x2 = int((input('Enter a value for x2: '))) x1 = int((input('Enter a value for x1: '))) y1 = int((input('Enter a value for y2: '))) y2 = int((input('Enter a value for y1: '))) print('') e = distanceFormula(x2, x1, y2, y1) e.execFormula() print('') print(f.resultFormula()) print(e.resultFormula()) if __name__ == "__main__": main()