Previous Up Next

6.41.11  Avoir la liste permutée à partir de son n-ième élément : shift

shift a comme argument une liste et un nombre entier relatif (par défaut n=-1).
shift renvoie :

On tape :

shift([0,1,2,3,4])

On obtient :

[undef,0,1,2,3]

On tape :

shift([0,1,2,3,4],2)

On obtient :

[2,3,4,undef,undef]

On tape :

shift([0,1,2,3,4],-2)

On obtient :

[undef,undef,0,1,2]

Previous Up Next