def distance(alist, blist):
sum_of = 0
for x in alist:
for y in blist:
ans = (x - y)**2
sum_of += ans
return (sum_of)**(1/2)
print(distance([1, 1, 3], [2, 2, 3])) #1.4142135623730951
print(distance([1, 2, 3], [2, 2, 3])) #1.0
print(distance([2, 2, 3], [2, 2, 3])) #0.0
print(distance([1, 1], [2, 2])) #1.4142135623730951
So I have a set of test cases which give me two lists with numbers. My task is to calculate the euclidean distance with the given lists. However, I am not getting the right results. I am instead getting 3.7416573867739413, 3.0, 2.0 and 2.0. This is what I have so far, and I am not sure what I am doing wrong.