rotation de la gauche python
def rotate(l, n):
return l[n:] + l[:n]
print(rotate([1, 2, 3, 4, 5], 2))
#output : [3, 4, 5, 1, 2]
Xanthous Xenomorph
def rotate(l, n):
return l[n:] + l[:n]
print(rotate([1, 2, 3, 4, 5], 2))
#output : [3, 4, 5, 1, 2]