From 96bae7535401db590fe39d33f62bac1e57ecef96 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 13 Dec 2021 10:19:16 +0000 Subject: - Added Python solution to the task "Calculator" of the week 143. --- challenge-143/mohammad-anwar/python/ch-1.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 challenge-143/mohammad-anwar/python/ch-1.py diff --git a/challenge-143/mohammad-anwar/python/ch-1.py b/challenge-143/mohammad-anwar/python/ch-1.py new file mode 100644 index 0000000000..9140f40f64 --- /dev/null +++ b/challenge-143/mohammad-anwar/python/ch-1.py @@ -0,0 +1,29 @@ +#!/usr/bin/python3 + +''' + +Week 143: + + https://theweeklychallenge.org/blog/perl-weekly-challenge-143 + +Task #1: Calculator + + Write a script to find lowest 10 positive integers having exactly 8 divisors. + +''' + +import unittest + +# +# +# Unit test class + +class TestJortSort(unittest.TestCase): + + def test_example_1(self): + self.assertEqual(eval('10 + 20 - 5'), 25, 'Example 1') + + def test_example_2(self): + self.assertEqual(eval('(10 + 20 - 5) * 2'), 50, 'Example 2') + +unittest.main() -- cgit