aboutsummaryrefslogtreecommitdiff
path: root/challenge-122/abigail/python
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2021-07-24 23:11:35 +0200
committerAbigail <abigail@abigail.be>2021-07-24 23:11:35 +0200
commit62818508c81af33a19e400cce9145e681920eb82 (patch)
treef11e3508db11b31712703cf4d5d02640cadc4a3d /challenge-122/abigail/python
parent52d0e0851f79fead3bdad2caed25e012a124a8eb (diff)
downloadperlweeklychallenge-club-62818508c81af33a19e400cce9145e681920eb82.tar.gz
perlweeklychallenge-club-62818508c81af33a19e400cce9145e681920eb82.tar.bz2
perlweeklychallenge-club-62818508c81af33a19e400cce9145e681920eb82.zip
Solutions for week 122, part 2, in 8 different languages.
Diffstat (limited to 'challenge-122/abigail/python')
-rw-r--r--challenge-122/abigail/python/ch-2.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/challenge-122/abigail/python/ch-2.py b/challenge-122/abigail/python/ch-2.py
new file mode 100644
index 0000000000..2c10b39f25
--- /dev/null
+++ b/challenge-122/abigail/python/ch-2.py
@@ -0,0 +1,25 @@
+#!/opt/local/bin/python
+
+#
+# See ../README.md
+#
+
+#
+# Run as: python ch-2.py < input-file
+#
+
+import sys
+
+n = int (sys . stdin . readline ())
+
+scores = [[], [], [""]]
+
+for i in range (n):
+ new = []
+ for j in range (3):
+ for k in scores [len (scores) - 1 - j]:
+ new . append (str (j + 1) + " " + k)
+ scores . append (new)
+
+for score in scores [-1]:
+ print (score)