《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)
相关推荐
飞猪~7 小时前
LangChain python 版本 第一集
开发语言·python·langchain
2601_956319888 小时前
最新AI量化提效,先做可验证的小流程
人工智能·python
开飞机的舒克_9 小时前
FastAPI 实战入门:从路由、参数校验到依赖注入的后端开发指南
python·fastapi
霸道流氓气质10 小时前
Kiro 中反编译 JAR 包并分析字节码的流程指南
chrome·python·jar
人工智能时代 准备好了吗10 小时前
AI回答内容进入率监测:引用识别、文本匹配与语义判断
开发语言·人工智能·python
Metaphor69211 小时前
使用 Python 冻结 Excel 文件中的行、列和单元格
开发语言·python·excel
言乐611 小时前
Python实现建造微服务商城后台
开发语言·python·算法·微服务·架构
fenglllle11 小时前
chromadb emmbedding 向量检索
人工智能·python·embedding
cui_ruicheng11 小时前
Python从入门到实战(六):非序列容器
开发语言·python
百里香酚兰12 小时前
【python学习笔记】pyttsx3库疑似只播报一次语音
笔记·python·学习