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"]
python
l = ["apple", "orange", "grapes", "bananas"] first, l = l[0], l[1:] + l[:1]
l = ["apple", "orange", "grapes", "bananas"] first, l = l[0], l[1:] + l[:1]
python
fruit = ['apple', 'orange', 'grapes', 'bananas'] fruit.append(fruit.pop(0))
fruit = ['apple', 'orange', 'grapes', 'bananas'] fruit.append(fruit.pop(0))