《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)
相关推荐
Li#10 分钟前
AI编写操作使用说明书需要用到的工具和能力
python·ai编程·ai写作
红宝村村长18 分钟前
torch.autograd.Function.apply()
开发语言·python
花间相见21 分钟前
【LeetCode01】—— 无重复字符的最长子串:滑动窗口经典题详解
python·算法·leetcode
何以解忧,唯有..27 分钟前
Python 中的继承机制:从基础到高级用法详解
java·开发语言·python
try2find1 小时前
agent环境安装spacy
python·智能体
ellenwan20261 小时前
期货程序化开平标志错了总拒单:天勤 last_msg 排查思路
python
装不满的克莱因瓶1 小时前
自动微分的原理:计算图与前向传播
人工智能·pytorch·python·数学·ai·微积分·计算图
console.log('npc')1 小时前
将 Figma 接入 Codex MCP:从 `/plugins` 到本地插件配置的完整教程
前端·人工智能·python·figma·code·codex·mcp
资深流水灯工程师2 小时前
PySide6 QMainWindow与QWidget秒解
开发语言·python
popcorn_min2 小时前
California Housing 可复现回归实验:随机森林预测加州房价
python