Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # list_shift_by_value.py
- d = range(0,20)
- def shift(seq, n=1):
- n = n % len(seq)
- return seq[n:] + seq[:n]
- #
- for i in '!'*5:
- d=shift(d)
- print d
- d=shift(d,3)
- print d
- d=shift(d,30)
- print d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement