From 68db3a72f2403cdb07712741e7749279d69099ec Mon Sep 17 00:00:00 2001 From: Andrew4me <33133905+Andrew4me@users.noreply.github.com> Date: Wed, 20 Jun 2018 18:24:35 +0500 Subject: [PATCH 1/2] Update tests.py --- homework/tests.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/homework/tests.py b/homework/tests.py index 90a295b..dac7cfb 100644 --- a/homework/tests.py +++ b/homework/tests.py @@ -5,7 +5,8 @@ def test_even_fucntion(): """ def even_filter(*args): - pass + even = [x for x in args if x % 2 == 0] + return even assert even_filter(1, 2, 3, 4, 5, 6) == [2, 4, 6] @@ -16,7 +17,10 @@ def test_increment_decorator(): декрорируемую функцию. """ def increment_derocator(func): - pass + def wrap(arg1): + arg2 = arg1 + 1 + return func(arg2) + return wrap @increment_derocator def returner(value): @@ -41,10 +45,12 @@ def __init__(self, x, y): class Segment(): def __init__(self, p1, p2): - pass + self.p1 = p1 + self.p2 = p2 def length(self): - return 0 + dist = math.hypot(self.p2.x - self.p1.x, self.p2.y - self.p1.y) + return dist p1 = Point(0, 0) p2 = Point(3, 4) From 30a5136524912d212f12d85db63a645ed8ca0b6d Mon Sep 17 00:00:00 2001 From: Andrew4me <33133905+Andrew4me@users.noreply.github.com> Date: Wed, 20 Jun 2018 20:12:31 +0500 Subject: [PATCH 2/2] Update tests.py --- homework/tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homework/tests.py b/homework/tests.py index dac7cfb..e679660 100644 --- a/homework/tests.py +++ b/homework/tests.py @@ -1,3 +1,6 @@ +import math + + def test_even_fucntion(): """ Необходимо реализовать функцию even_filter, которая получает неограниченное количество аргументов