你好同学,代码供参考:
from math import * x1,y1 = map(lambda x:int(x),list(input().split(' '))) x2,y2 = map(lambda x:int(x),list(input().split(' '))) d = sqrt( (x2-x1)**2 + (y2-y1)**2) print(d)
输入输出示例:
1 2 3 4 2.8284271247461903