View Problem

Rotate a list

Given a list ["apple", "orange", "grapes", "bananas"], rotate it by removing the first item and placing it on the end to yield ["orange", "grapes", "bananas", "apple"]
DiskEdit
python
l = ["apple", "orange", "grapes", "bananas"]
first, l = l[0], l[1:] + l[:1]
DiskEdit
python
fruit = ['apple', 'orange', 'grapes', 'bananas']
fruit.append(fruit.pop(0))

Submit a new solution for python
There are 21 other solutions in additional languages (clojure, cpp, csharp, erlang ...)