《python语言程序设计》2018版第6章第20题几何问题,显示角 使用distance函数计算两点之间的距离

python 复制代码
def distance(x1, y1, x2, y2):
    x1, y1 = eval(input("Enter x1 and y1 for point1: "))
    x2, y2 = eval(input("Enter x2 and y2 for point2: "))

    distance_t = ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) ** 0.5

    print("The distance between the two points is", distance_t)
相关推荐
yBmZlQzJ5 分钟前
PyQt5 修改标签字体和颜色的程序
开发语言·python·qt
胖达不服输8 分钟前
「日拱一码」081 机器学习——梯度增强特征选择GBFS
人工智能·python·算法·机器学习·梯度增强特征选择·gbfs
float_六七10 分钟前
Java Stream流:从入门到精通
java·windows·python
星空的资源小屋18 分钟前
PPTist,一个完全免费的 AI 生成 PPT 在线网站
人工智能·python·电脑·excel
程序员的世界你不懂1 小时前
【Flask】测试平台开发,工具模块开发 第二十二篇
android·python·flask
薰衣草23331 小时前
滑动窗口(2)——不定长
python·算法·leetcode
User_芊芊君子2 小时前
【JavaSE】复习总结
java·开发语言·python
计算机毕业设计木哥2 小时前
计算机毕业设计 基于Python+Django的医疗数据分析系统
开发语言·hadoop·后端·python·spark·django·课程设计
Python×CATIA工业智造2 小时前
Python索引-值对迭代完全指南:从基础到高性能系统设计
python·pycharm
Luchang-Li3 小时前
sglang pytorch NCCL hang分析
pytorch·python·nccl