Answers for "Write a Python program to compute the distance between the points (x1, y1) and (x2, y2). Accept values from the user for x1,y1,x2 and y2."

4

distance formula in python

import math.
def calculateDistance(x1,y1,x2,y2):
dist = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
return dist.
print calculateDistance(x1, y1, x2, y2)
Posted by: Guest on May-02-2020

Code answers related to "Write a Python program to compute the distance between the points (x1, y1) and (x2, y2). Accept values from the user for x1,y1,x2 and y2."

Python Answers by Framework

Browse Popular Code Answers by Language