Created
April 16, 2017 19:21
-
-
Save ebovio/e4300d1ef2cf9b812fce0983cfa1f308 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Problem1 | |
import math | |
def dist(x1, y1, x2, y2): | |
x = x2-x1 | |
y = y2-y1 | |
z = (x**2) + (y**2) | |
ans= math.sqrt(z) | |
return ans | |
#MainProgramBelow | |
x1 = float(input("Write the x value for the first coordinate")) | |
y1 = float(input("Write the y value for the first coordinate")) | |
x2 = float(input("Write the x value for the second coordinate")) | |
y2 = float(input("Write the y value for the second coordinate")) | |
print("The distance in between the two coordinates is:", dist(x1, y1, x2, y2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment