《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)
相关推荐
第一程序员18 分钟前
Python与区块链:非科班转码者的指南
python·github
liu****28 分钟前
LangChain-AI应用开发框架(六)
人工智能·python·langchain·大模型应用·本地部署大模型
witAI1 小时前
**AI仿真人剧制作2025推荐,专业团队与创新技术引领未来**
人工智能·python
♪-Interpretation1 小时前
第五节:Python的流程控制语句
python
shark22222222 小时前
Python 爬虫实战案例 - 获取社交平台事件热度并进行影响分析
开发语言·爬虫·python
m0_564876842 小时前
提示词工程手册学习
人工智能·python·深度学习·学习
波诺波3 小时前
p1项目system_model.py代码
开发语言·python
静心观复3 小时前
Python 虚拟环境与 pipx 详解
开发语言·python
卷心菜狗3 小时前
Re.从零开始使用Python构建本地大模型网页智慧聊天机器人
开发语言·python·机器人
书到用时方恨少!3 小时前
Python NumPy 使用指南:科学计算的基石
开发语言·python·numpy