title: Python function is changing the value of my input, and I can't figure out why
body: <p>This is my first question, so if I'm being a total dweeb posting this, let me know why and how I can avoid it in the future!</p>
  
  <p>I have a bit of python code that should just take a list, and multiply the jth component by -1. This is the code in question.</p>
  
  <pre><code>def flip(spins,j):
      z = spins
      z[j] = z[j]*-1
      return z
  </code></pre>
  
  <p>However, what I am noticing is that if I try to do something like</p>
  
  <pre><code>spin = [1,1,1]
  test = flip(spin,1)
  </code></pre>
  
  <p>it will assign the proper value [1,-1,1] to 'test', but it will also change the value of 'spin' to [1,-1,1]. I know there must be something totally obvious I'm overlooking, but I've been staring at this for 2 hours and still can't see it.</p>
  
  <p>Thanks for your help!</p>