euclidean distance python 3 variables

# Python code to find Euclidean distance 
# using sum() and square() 
  
import numpy as np 
  
# intializing points in 
# numpy arrays 
point1 = np.array((1, 2, 3)) 
point2 = np.array((1, 1, 1)) 
  
# finding sum of squares 
sum_sq = np.sum(np.square(point1 - point2)) 
  
# Doing squareroot and 
# printing Euclidean distance 
print(np.sqrt(sum_sq)) 

Here is what the above code is Doing:
1. We first import the NumPy library.
2. We then create two NumPy arrays, point1 and point2.
3. We then use the NumPy function sum() to find the sum of the squares of the differences between the points.
4. We then use the NumPy function sqrt() to take the square root of the sum of the squares of the differences between the points.
5. We then print the Euclidean distance between the points.

Note that we could have also used the NumPy function linalg.norm() to find the Euclidean distance between the points.