title: Shift list elements to the right and shift list element at the end to the beginning
body: <p>I want to rotate elements in a list, e.g. - shift the list elements to the right so <code>['a','b','c','d']</code> would become <code>['d','a','b','c']</code>, or <code>[1,2,3]</code> becomes <code>[3,1,2]</code>. <br><p>
  I tried the following, but it's not working:</p>
  
  <pre><code>def shift(aList):
      n = len(aList)
      for i in range(len(aList)):
          if aList[i] != aList[n-1]:
              aList[i] = aList[i+1]
               return aList
           elif aList[i] == aList[i-1]:
              aList[i] = aList[0]
              return aList
  shift(aList=[1,2,3])
  </code></pre>