主页
Python
Python math.dist() 方法
demo_ref_math_dist
运行 ❯
×
更改方向
保存代码
更改主题
# Import math Library import math p = [3] q = [1] # Calculate Euclidean distance print (math.dist(p, q)) p = [3, 3] q = [6, 12] # Calculate Euclidean distance print (math.dist(p, q))
C:\Users\My Name>python demo_math_dist.py
2.0
9.486832980505138