What is the most efficient way to rotate a list in python? Right now I have something like this:
>>> def rotate(l, n): ... return l[n:] + l[:n]
I have similar thing. For example, to shift by two...
def Shift(*args): return args[len(args)-2:]+args[:len(args)-2]