The math.dist() function calculates the Euclidean distance between two points in a given space.

Syntax:
math.dist(p,q)
copy

Where, parameters p and  q  are iterables representing the first point  and the second point in two-dimensional space, respectively.

This function returns the Euclidean distance between two points. The value returned is roughly equivalent to: sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))

ExampleEdit & Run
import math 

print(math.dist((4, 7), (3, 12)))
print(math.dist([9, 5, 4], [1, 2, 4]))
print(math.dist((1.5, 2.5), (3.1, 4.5)))
copy
Output:
5.0990195135927845 8.54400374531753 2.5612496949731396 [Finished in 0.011958356015384197s]