forked from tdwojak/Python2017
commited tasks
This commit is contained in:
parent
4576474620
commit
464d765a82
@ -11,8 +11,9 @@ np. odległość pomiędzy punktami (0, 0, 0) i (3, 4, 0) jest równa 5.
|
||||
|
||||
def euclidean_distance(x, y):
|
||||
dist = 0
|
||||
for a,b in x,y:
|
||||
dist = (sum(a-b)**2)**0.5
|
||||
for i in range(len(x)):
|
||||
dist += (x[i]-y[i])**2
|
||||
dist = dist**0.5
|
||||
return dist
|
||||
|
||||
def tests(f):
|
||||
|
Loading…
Reference in New Issue
Block a user