Python – math.dist() method
Math module in Python contains a number of mathematical operations, which can be performed with ease using the module.
math.dist() method in Python is used to the Euclidean distance between two points p and q, each given as a sequence (or iterable) of coordinates. The two points must have the same dimension.
This method is new in Python version 3.8.
Syntax: math.dist(p, q)
p: A sequence or iterable of coordinates representing first point
q: A sequence or iterable of coordinates representing second point
Returns: the calculated Euclidean distance between the given points.
Code #1: Use of
Reference: Python math library