I want to display a list with order modulo N, for exemple:
With N =6, I have a list l[k]=[1, 2, 3, 4, 5, 6]
, so I can display its revers l[-k]=[6,5,4,3,2,1]
by the instruction l[::-1]
.
But now I want to display l[(-k)mod N]
which is [1,6,5,4,3,2]
and then l[(1-k)mod N]
which is [2,1,6,5,4,3]
and so on.
Is there any instruction in python for display a list like that?