import math # Calculate the distance between two points. def distance(x1, y1, x2, y2): xdiff = x2 - x1 ydiff = y2 - y1 result = math.sqrt((xdiff * xdiff) + (ydiff * ydiff)) return result def distance2(x1, y1, x2, y2): xdiff = x2 - x1 ydiff = y2 - y1 result = ((xdiff ** 2) + (ydiff **2)) ** 0.5 return result def main(): # Get two points from the user. print("Enter coordinates for the first point: ") x1 = int(input()) y1 = int(input()) print("Enter coordinates for the second point: ") x2 = int(input()) y2 = int(input()) # Call function to figure out distance. dist = distance(x1, y1, x2, y2) dist2 = distance2(x1, y1, x2, y2) # Print distance to screen. print("Distance between the points is: ", dist) print("Distance between the points is: ", dist2)