1
0
forked from tdwojak/Python2017

z1, z2, z3, z4, z5

This commit is contained in:
s45148 2017-11-28 21:37:54 +01:00
parent 72eb9d01e2
commit b67a851e9d

View File

@ -10,7 +10,12 @@ np. odległość pomiędzy punktami (0, 0, 0) i (3, 4, 0) jest równa 5.
""" """
def euclidean_distance(x, y): def euclidean_distance(x, y):
pass l = [x,y]
edl = []
for c1 in range(3):
edl.append(l[0][c1] - l[1][c1])
edl2 = [i**2 for i in edl]
return ( sum(edl2) ) ** 0.5
def tests(f): def tests(f):
inputs = [[(2.3, 4.3, -7.5), (2.3, 8.5, -7.5)]] inputs = [[(2.3, 4.3, -7.5), (2.3, 8.5, -7.5)]]