From 1d1e87cff0f2ce50c2055f082a2d19bb18e1bc77 Mon Sep 17 00:00:00 2001 From: Cortes Date: Sun, 14 Jun 2020 12:30:24 -0500 Subject: [PATCH] =?UTF-8?q?soluci=C3=B3n=20reto=2006?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- challenge.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/challenge.py b/challenge.py index 2653d7e..5f16b26 100644 --- a/challenge.py +++ b/challenge.py @@ -3,7 +3,9 @@ def make_division_by(n): of an x number by n """ # You have to code here! - pass + def division(x): + return x/n + return division def run(): @@ -23,6 +25,9 @@ def run(): class ClosureSuite(unittest.TestCase): def test_closure_make_division_by(self): # Make the closure test here - pass - + num = {6:[3,18], 20:[5,100], 3:[18,54]} + for key, value in num.items(): + division = make_division_by(value[0]) + self.assertEqual(division(value[1]), key) + run()