# # # from math import sqrt def distance(x1, y1, x2, y2): return sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) #def inputpoint(prompt): # return float(input("Please enter the co-ordinate for " + prompt)) def inputpoint(xory, pointname): return float(input("Please enter the " + xory + " co-ordinate for the " + pointname + " point> ")) # Enter the x coordinate of the first point" x1 = inputpoint("x", "first") y1 = inputpoint("y", "first") x2 = inputpoint("x", "second") y2 = inputpoint("y", "second") x3 = inputpoint("x", "third") y3 = inputpoint("y", "third") print(x1, y1, x2, y2, x3, y3) # side lengths side1length = distance(x1, y1, x2, y2) side2length = distance(x2, y2, x3, y3) side3length = distance(x3, y3, x1, y1) # add to get perimeter and print it perimeter = side1length + side2length + side3length print("Perimeter:", perimeter)