rotate_left function
A list with its elements moved to the left, the first ones going to the end.
How to write it
rotate_left(list)
One place.
- list
- The list. Takes a list.
rotate_left(list, n)
Several places.
- list
- The list. Takes a list.
- n
- How many places. Takes a whole number.
Examples
rotate_left([1, 2, 3])In the solver,
Open in the solverrotate_left([1, 2, 3])gives[2, 3, 1].rotate_left([1, 2, 3], 2)In the solver,
Open in the solverrotate_left([1, 2, 3], 2)gives[3, 1, 2].