From 50ec721ed5fb323bd873233a8b9674c216b12849 Mon Sep 17 00:00:00 2001 From: s45167 Date: Thu, 30 Nov 2017 21:53:57 +0100 Subject: [PATCH] update test task Signed-off-by: s45167 --- labs02/task05.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/labs02/task05.py b/labs02/task05.py index f59268a..7105e84 100644 --- a/labs02/task05.py +++ b/labs02/task05.py @@ -10,6 +10,10 @@ np. odległość pomiędzy punktami (0, 0, 0) i (3, 4, 0) jest równa 5. """ def euclidean_distance(x, y): + if len(x) != len(y): + return 0 + else: + return ((x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2) ** (1 / 2) pass def tests(f):