我想製作一個程序來查找兩個座標之間的距離。有人能幫助我,我哪裏出錯了嗎?Python 3.5.2調用函數時出錯?
代碼:
from math import *
prompt= input('Enter the coordinates \n')
x= input()
x1= input()
y= input()
y1= input()
def dist(x,y,x1,y1):
dx=x1-x
dy=y1-y
return sqrt(dx**2 + dy**2)
print ('The distance/Radius is: \n')
dist(x,y,x1,y1)
大概你被告知它不能減去字符串......想知道爲什麼會這樣? – jonrsharpe