Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [361]: l = list(range(20))
- In [362]: l
- Out[362]: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
- In [363]: l[:] = l[:1] + l[m:m+n] + [x for i,x in enumerate(l[1:]) if not m <= i <= m+n]
- In [364]: l
- Out[364]: [0, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 14, 15, 16, 17, 18, 19]
Add Comment
Please, Sign In to add comment