From 072e56debd2352fe1083d024e5b97e6c1ab31b48 Mon Sep 17 00:00:00 2001 From: FrcGustavo Date: Wed, 22 Apr 2020 19:21:48 -0500 Subject: [PATCH] challenge finish --- challenge.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/challenge.py b/challenge.py index 2653d7e..a079244 100644 --- a/challenge.py +++ b/challenge.py @@ -2,8 +2,10 @@ 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 + def second_parameter(x): + return round(x / n, 1) + + return second_parameter def run(): @@ -22,7 +24,7 @@ def run(): class ClosureSuite(unittest.TestCase): def test_closure_make_division_by(self): - # Make the closure test here - pass + self.assertEqual(20, make_division_by(5)(100)) + # unittest.main() run()