aboutsummaryrefslogtreecommitdiff
path: root/challenge-078/ash/python/ch-2.py
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2020-09-20 12:55:25 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2020-09-20 12:55:25 +0100
commitc0c14623badaca931c9dcc1c72e08aed10ee3afd (patch)
treed291844a13e0e0f74872b388593d4c04c95106d8 /challenge-078/ash/python/ch-2.py
parent1f086751d9b2b27dcf441111093d6311ce775ce6 (diff)
parentbae936a4696dc4314489ce6b7bac87f227f2c852 (diff)
downloadperlweeklychallenge-club-c0c14623badaca931c9dcc1c72e08aed10ee3afd.tar.gz
perlweeklychallenge-club-c0c14623badaca931c9dcc1c72e08aed10ee3afd.tar.bz2
perlweeklychallenge-club-c0c14623badaca931c9dcc1c72e08aed10ee3afd.zip
Merge branch 'master' of https://github.com/manwar/perlweeklychallenge-club
Diffstat (limited to 'challenge-078/ash/python/ch-2.py')
-rw-r--r--challenge-078/ash/python/ch-2.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/challenge-078/ash/python/ch-2.py b/challenge-078/ash/python/ch-2.py
new file mode 100644
index 0000000000..079e92d1b0
--- /dev/null
+++ b/challenge-078/ash/python/ch-2.py
@@ -0,0 +1,19 @@
+# Task 2 from
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-078/
+#
+# Comments: https://andrewshitov.com/2020/09/14/the-weekly-challenge-078/
+#
+# Output:
+#
+# [40, 50, 10, 20, 30]
+# [50, 10, 20, 30, 40]
+
+from collections import deque
+
+a = [10, 20, 30, 40, 50]
+b = [3, 4]
+
+for x in b:
+ d = deque(a)
+ d.rotate(-x)
+ print(list(d))