The question is to write a shift_right function so that it shifts every element in the list to the right. For instance, if the list is
shift_right
L = [\'a\',\
I'd implement it like this:
def shift_right(L): if len(L) > 0: L.insert(0, L.pop())
As Lee correctly comments, this is a rotate operation rather then a shift.