# 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

- $\displaystyle \operatorname{rotate\_left}(\left[ 1, 2, 3 \right]) = \left[ 2, 3, 1 \right]$

  `rotate_left([1, 2, 3])`

  In the solver, `rotate_left([1, 2, 3])` gives `[2, 3, 1]`.

  [Open in the solver](https://hilberon.com/?q=rotate_left%28%5B1%2C%202%2C%203%5D%29)
- $\displaystyle \operatorname{rotate\_left}(\left[ 1, 2, 3 \right], 2) = \left[ 3, 1, 2 \right]$

  `rotate_left([1, 2, 3], 2)`

  In the solver, `rotate_left([1, 2, 3], 2)` gives `[3, 1, 2]`.

  [Open in the solver](https://hilberon.com/?q=rotate_left%28%5B1%2C%202%2C%203%5D%2C%202%29)

## Related functions

- [rotate_right](https://hilberon.com/library/rotate_right)

  A list with its elements moved to the right, the last ones going to the front.
- [riffle](https://hilberon.com/library/riffle)

  A list with a value put between its elements.
- [select](https://hilberon.com/library/select)

  The elements of a list for which a test holds.
- [reverse](https://hilberon.com/library/reverse)

  A list in reverse order.
- [sort](https://hilberon.com/library/sort)

  A list in increasing order.
- [rest](https://hilberon.com/library/rest)

  A list without its first element.

---
Source: https://hilberon.com/library/rotate_left
