Write a python program to calculate the distance between two points.

 

Write a python program to calculate the distance between two points.


PROGRAM:

x1=float(input("Enter x1:"))
y1=float(input("Enter y1:"))
x2=float(input("Enter x2:"))
y2=float(input("Enter y2:"))
d=(((x2-x1)**2)+((y2-y1)**2))**0.5
print("Distance between two points:",d,"units")

OUTPUT:

No comments:

Post a Comment




Copyright Ⓒ 2022 | Mechpedia | All Right Reserved.