题目: 分别输入两个点的坐标,计算两个点的距离 计算公式:((x1-x2)²+(y1-y2)²)½ 代码: import math x1=eval(input('x1=')) y1=eval(input('y1=')) x2=eval(input('x2=')) y2=eval(input('y2=')) d=math.sqrt(math.pow((x1-x2),2)+math.pow((y1-y2),2)) print("两点间的距离为:{:.2f}".format(d)) 运行结果: