From ba69657d6716c4dbb4ba3b51ca12df61de07398f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Olvera=20Vital?= Date: Sat, 25 Apr 2020 17:34:07 -0500 Subject: [PATCH] challenge solved --- challenge.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/challenge.py b/challenge.py index 2653d7e..b4e99d1 100644 --- a/challenge.py +++ b/challenge.py @@ -2,8 +2,7 @@ def make_division_by(n): """This closure returns a function that returns the division of an x number by n """ - # You have to code here! - pass + return lambda x: x / n def run(): @@ -22,7 +21,10 @@ def run(): class ClosureSuite(unittest.TestCase): def test_closure_make_division_by(self): - # Make the closure test here - pass - + self.assertEqual(6, make_division_by(3)(18)) + self.assertEqual(20, make_division_by(5)(100)) + self.assertEqual(3, make_division_by(18)(54)) + + unittest.main() + run()