title: Function works normally alone but doesn't work properly when calling several times. Python
body: <p>So the question is pretty strange. I wrote an algorithm to move contents of any list (array) by a given number of digits to the left.</p>
  
  <pre><code>DIGS = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
  
  # move functions
  def move(arr):
      this = arr
      first = this[0]
      for b in range(len(this) - 1):
          this[b] = this[b + 1]
      this[-1] = first
      return this
  
  def move_with_step(arr, step):
      this_arr = arr
      for a in range(step):
          this_arr = move(arr)
      return this_arr
  </code></pre>
  
  <p>And, obviously, when typing <code>print(move_with_step(DIGS, 5)</code> will give us the same DIGS array but twisted. It will be something like [ 5, 6, 7... 3, 4 ]. You get the idea. And in this case it works. BUT...</p>
  
  <blockquote>
    <p>The problem is: if I'd put this same call into the <code>for</code> loop like below or just one after another, it will give me wrong results which is kinda strange because it should'n modify DIGS itself and why is that happening IDK.</p>
  </blockquote>
  
  <p>So this code</p>
  
  <pre><code>for a in range(1, 6):
      print(move_with_step(DIGS, a))
  </code></pre>
  
  <p>Returns this</p>
  
  <pre><code>[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
  [3, 4, 5, 6, 7, 8, 9, 0, 1, 2]
  [6, 7, 8, 9, 0, 1, 2, 3, 4, 5]
  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  [5, 6, 7, 8, 9, 0, 1, 2, 3, 4]
  </code></pre>
  
  <p>in the console. Which is crazy and totally wrong. Why is that?</p>