title: Why are these two arrays the same?
body: <p>I want to have a copy of my list, and then sort it, but due of the way that python works, if i sort the copy of the list, it sort also the original list. Here is my code:</p>
  <pre><code>def swapBySoting(arr):
      newArr = arr
      newArr.sort()
      swap = 0
      for i in range(len(arr)):
          if arr[i] != newArr[i]:
              swap +=1
      return int(swap / 2)
  </code></pre>
  <p>I only need to know how to store the copy in another reference of memory, to sort only the copy. Thanks</p>