aboutsummaryrefslogtreecommitdiff
path: root/challenge-078/ash/python/ch-2.py
blob: 079e92d1b05e6656a456f6d3ee676ae1b8830d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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))