I'm trying to make integers containing within value to shift from leftmost to rightmost. For example if values is [1,2,3,4,5] after running the code it would be [2,3,4,5,1].
I managed to write the code but I some how made the value shift from rightmost to leftmost which is other way around. Like [5,1,2,3,4]. Been sitting for hours trying to figure it out, any hands? Thank you
values = [1,2,3,4,5]
temp = values[len(values) - 1]
for index in range(len(values) - 1, 0, -1):
values[index] = values[index - 1]
values[0] = temp
print values