Write a Python program to compute distance between two points taking input from the user. Formula for Pythagorean theorem for compute distance between two points is:

1)b)Write a Python program to compute distance between two points taking
input from the user. Formula for Pythagorean theorem for compute distance
between two points is:

 

n1=int(input("Enter the value of point 1_ x-axis"))

n2=int(input("Enter the value of point 1_y-axis"))

n3=int(input("Enter the value of point 2 _x-axis "))

n4=int(input("Enter the value of point 2_y-axis"))

distance=(((n3-n1)**2)+((n4-n2)**2))**(0.5)

print("The distance for the given two cartesian points  are ",distance)

Comments

Popular posts from this blog

Write a python program to compute cumulative product of a list of numbers (write function cumulative_product).