aboutsummaryrefslogtreecommitdiff
path: root/challenge-115/stuart-little/python/ch-2.py
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-05-31 21:33:17 +0100
committerGitHub <noreply@github.com>2021-05-31 21:33:17 +0100
commit4945e504efdcde92d9df7153a7a4abcc2a916527 (patch)
tree4d70a503369413c154f14f53b1fe4eaf976127f6 /challenge-115/stuart-little/python/ch-2.py
parent5339668b0eb9fc3dc3de93badfaea9ffaa2ecd0c (diff)
parent91a046d22fdfe5f6b3216f90d31935badad986fc (diff)
downloadperlweeklychallenge-club-4945e504efdcde92d9df7153a7a4abcc2a916527.tar.gz
perlweeklychallenge-club-4945e504efdcde92d9df7153a7a4abcc2a916527.tar.bz2
perlweeklychallenge-club-4945e504efdcde92d9df7153a7a4abcc2a916527.zip
Merge pull request #4178 from stuart-little/stuart-little_115_python
1st commit on 115_python
Diffstat (limited to 'challenge-115/stuart-little/python/ch-2.py')
-rwxr-xr-xchallenge-115/stuart-little/python/ch-2.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/challenge-115/stuart-little/python/ch-2.py b/challenge-115/stuart-little/python/ch-2.py
new file mode 100755
index 0000000000..9e6792f289
--- /dev/null
+++ b/challenge-115/stuart-little/python/ch-2.py
@@ -0,0 +1,8 @@
+#!/usr/bin/env python
+
+# run <script> <space-separated digits>
+
+import re
+import sys
+
+print(attemptedOut if (int(attemptedOut := re.sub(r"(.)([13579]*)$", r"\2\1", "".join(sorted(sys.argv[1:], reverse=True)))) % 2 == 0) else "No even digits..")