Ivan Voras wrote: > I need to transform this: > > [1,2,3] > > into this: > > [2,3,1] If in-place transformation is OK, you could use: L = [1,2,3] L.append(L.pop(0)) # left rotation L.insert(0, L.pop()) # right rotation Jeffrey