aboutsummaryrefslogtreecommitdiff
path: root/challenge-263/ash/python
diff options
context:
space:
mode:
authorAndrew Shitov <mail@andreyshitov.com>2024-04-01 16:12:40 +0200
committerAndrew Shitov <mail@andreyshitov.com>2024-04-01 16:12:40 +0200
commita4a5c909234335cbf64764b067d3d0f23829f8fc (patch)
tree5052f4346218693eb07c74c83c8a248030f843f4 /challenge-263/ash/python
parentc9be1656455d23b019df372ed14a189133c588b1 (diff)
downloadperlweeklychallenge-club-a4a5c909234335cbf64764b067d3d0f23829f8fc.tar.gz
perlweeklychallenge-club-a4a5c909234335cbf64764b067d3d0f23829f8fc.tar.bz2
perlweeklychallenge-club-a4a5c909234335cbf64764b067d3d0f23829f8fc.zip
Week 263 Task 1 by ash
Diffstat (limited to 'challenge-263/ash/python')
-rw-r--r--challenge-263/ash/python/ch-1.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/challenge-263/ash/python/ch-1.py b/challenge-263/ash/python/ch-1.py
new file mode 100644
index 0000000000..945e73a9c1
--- /dev/null
+++ b/challenge-263/ash/python/ch-1.py
@@ -0,0 +1,19 @@
+# Solution of Task 1 of The Weekly Challenge 263
+# https://theweeklychallenge.org/blog/perl-weekly-challenge-263
+
+# $ python3 ch-1.py
+# [1, 2]
+# []
+# [4]
+
+tests = ((1, 5, 3, 2, 4, 2), (1, 2, 4, 3, 5), (5, 3, 2, 4, 2, 1))
+values = (2, 6, 4)
+
+def solve(test, value):
+ print(
+ [i for i, val in enumerate(sorted(test)) if val == value]
+ )
+
+for c in range(0, len(tests)):
+ solve(tests[c], values[c])
+