Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python distance calculator

#We need the math library for this
import math

x1, y1=int(input("Please enter a number: ")), int(input("Please enter a number: "))
x2, y2=int(input("Please enter a number: ")), int(input("Please enter a number: "))

distance = math.sqrt((x2-x1)**2 +(y2-y1)**2)
print("The distance is", distance)
 
PREVIOUS NEXT
Tagged: #python #distance #calculator
ADD COMMENT
Topic
Name
5+5 =