diff options
| author | Andrew Shitov <mail@andreyshitov.com> | 2024-04-01 16:12:40 +0200 |
|---|---|---|
| committer | Andrew Shitov <mail@andreyshitov.com> | 2024-04-01 16:12:40 +0200 |
| commit | a4a5c909234335cbf64764b067d3d0f23829f8fc (patch) | |
| tree | 5052f4346218693eb07c74c83c8a248030f843f4 /challenge-263/ash/python | |
| parent | c9be1656455d23b019df372ed14a189133c588b1 (diff) | |
| download | perlweeklychallenge-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.py | 19 |
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]) + |
