How do I find the euclidean distance between two lists without using either the numpy or the zip feature? Furthermore, the lists are of equal length, but the length of the lists are not defined.
For example:
ex 1.
list_1 = [0, 5, 6]
list_2 = [1, 6, 8]
ex2.
list_1 = [0, 1, 2, 3, 4]
list_2 = [5, 6, 7, 8, 9]
So far I have:
def euclidean_distance(p1, p2):
sum = 0
#(I think I need a for loop, possibly nested? --> For x in... for y in...)
ans = (x-y) ** 2
sum += ans
return (sum) ** (1/2)