Shifting elements in a list (Python)
<p>I am trying to run a code that shifts the values of a list three spots to the right. For instance, I have a list [1,2,3,-3,15,6,71,42] and I want to make the output [-3,15,6,71,42, 1,2,3 ], but the current output of the program is [-3, 15, 6, 71, 42, 8, 8, 8]. I cannot find the error, but the professor wants me to change <strong>ONLY ONE LINE OF CODE</strong> to fix the error. So the error must not be too hard to find. Except I can not seem to find it :D</p>

<p>Please help!</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>def foo1(values): 
   return values[0] 

def foo2(values):        
   for i in range(1,len(values)):
      values[i-1] = values[i]
      
def foo3(values,c):
      values[len(values)-c] = len(values)
   
def main(): 
   values = [1,2,3,-3,15,6,71,42] 
   k = 3
   for r in range(k): 
      a = foo1(values)       
      foo2(values)
      foo3(values,a)
      
      
       
      
   print("Here is the shifted list to the left for " + str(k) + " time:" )
   print(values)

   
main()</code></pre>
</div>
</div>
</p>