aboutsummaryrefslogtreecommitdiff
path: root/challenge-149/abigail/python
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.freedom.nl>2022-01-24 21:17:26 +0100
committerAbigail <abigail@abigail.freedom.nl>2022-01-25 02:00:52 +0100
commit158e2b79cc16f52dd755457be2a39eaa669de421 (patch)
tree72422a4ecdae4ef9441f75e0473444c08d5ea2f1 /challenge-149/abigail/python
parent855d436b931866b06fd71890dad7151fb200364f (diff)
downloadperlweeklychallenge-club-158e2b79cc16f52dd755457be2a39eaa669de421.tar.gz
perlweeklychallenge-club-158e2b79cc16f52dd755457be2a39eaa669de421.tar.bz2
perlweeklychallenge-club-158e2b79cc16f52dd755457be2a39eaa669de421.zip
Week 149, part 2: Solutions in 16 languages.
Diffstat (limited to 'challenge-149/abigail/python')
-rw-r--r--challenge-149/abigail/python/ch-2.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/challenge-149/abigail/python/ch-2.py b/challenge-149/abigail/python/ch-2.py
new file mode 100644
index 0000000000..68b490cfa4
--- /dev/null
+++ b/challenge-149/abigail/python/ch-2.py
@@ -0,0 +1,42 @@
+#!/usr/local/bin/python3
+
+#
+# See https://theweeklychallenge.org/blog/perl-weekly-challenge-149
+#
+
+#
+# Run as: python ch-2.py < input-file
+#
+
+A287298 = {}
+
+A287298 [ 2] = "1"
+A287298 [ 3] = "1"
+A287298 [ 4] = "3201"
+A287298 [ 5] = "4301"
+A287298 [ 6] = "452013"
+A287298 [ 7] = "6250341"
+A287298 [ 8] = "47302651"
+A287298 [ 9] = "823146570"
+A287298 [10] = "9814072356"
+A287298 [11] = "A8701245369"
+A287298 [12] = "B8750A649321"
+A287298 [13] = "CBA504216873"
+A287298 [14] = "DC71B30685A924"
+A287298 [15] = "EDAC93B24658701"
+A287298 [16] = "FED5B39A42706C81"
+A287298 [17] = "GFED5A31C6B79802"
+A287298 [18] = "HGF80ADC53712EB649"
+A287298 [19] = "IHGFD3408C6E715A2B9"
+A287298 [20] = "JIHG03DAC457BFE96281"
+A287298 [22] = "LKJIG5D14B9032FHAC867E"
+
+
+import fileinput
+
+for n in fileinput . input ():
+ n = int (n)
+ if n in A287298:
+ print (A287298 [n])
+ else:
+ print ("Too hard to calculate")