aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2021-12-13 10:19:16 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2021-12-13 10:19:16 +0000
commit96bae7535401db590fe39d33f62bac1e57ecef96 (patch)
treeb6a9ccd3f2d63831bf466ae854e3db735e11020c
parent3c169f198d622e6f460dc7796985592ede954ac6 (diff)
downloadperlweeklychallenge-club-96bae7535401db590fe39d33f62bac1e57ecef96.tar.gz
perlweeklychallenge-club-96bae7535401db590fe39d33f62bac1e57ecef96.tar.bz2
perlweeklychallenge-club-96bae7535401db590fe39d33f62bac1e57ecef96.zip
- Added Python solution to the task "Calculator" of the week 143.
-rw-r--r--challenge-143/mohammad-anwar/python/ch-1.py29
1 files changed, 29 insertions, 0 deletions
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()