rotate_left_3

Given a list of ints length 3, return a list with the elements “rotated left” so [1, 2, 3] yields [2, 3, 1].

This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.

Test 1

Input:

[1, 2, 3]

Output:

[2, 3, 1]

Test 2

Input:

[5, 11, 9]

Output:

[11, 9, 5]

Test 3

Input:

[7, 0, 0]

Output:

[0, 0, 7]

Test 4

Input:

[1, 2, 1]

Output:

[2, 1, 1]

Test 5

Input:

[0, 0, 1]

Output:

[0, 1, 0]