left_2

Given a string, return a “rotated left 2” version where the first 2 chars are moved to the end. The string length will be at least 2.

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:

'Hello'

Output:

'lloHe'

Test 2

Input:

'java'

Output:

'vaja'

Test 3

Input:

'Hi'

Output:

'Hi'

Test 4

Input:

'code'

Output:

'deco'

Test 5

Input:

'cat'

Output:

'tca'

Test 6

Input:

'12345'

Output:

'34512'

Test 7

Input:

'Chocolate'

Output:

'ocolateCh'

Test 8

Input:

'bricks'

Output:

'icksbr'