From b67a851e9d3953d2de5d3347f47243b97a07c2a2 Mon Sep 17 00:00:00 2001 From: s45148 Date: Tue, 28 Nov 2017 21:37:54 +0100 Subject: [PATCH] z1, z2, z3, z4, z5 --- labs02/task05.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/labs02/task05.py b/labs02/task05.py index f59268a..5d9ff8f 100644 --- a/labs02/task05.py +++ b/labs02/task05.py @@ -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): - 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): inputs = [[(2.3, 4.3, -7.5), (2.3, 8.5, -7.5)]]