title: Copying lists: editing copy without changing original
body: <p>I'm making a program that requires and editable temp array that does not affect the original. However, whenever I run the function and test it, it edits the actual array like so:</p>
  
  <pre><code>x = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
  y = copying(x)
  y[0][0] = 1
  print(x)
  [[1, 0, 0], [0, 0, 0], [0, 0, 0]]
  </code></pre>
  
  <p>Here is the function:</p>
  
  <pre><code>def copying(array):
      temp = []
  
      for i in array:
          temp.append(i)        
      return temp
  </code></pre>
  
  <p>The function works for flat lists, but the array entry doesn't work. Is there an alternative that I should use? (I have attempted list() and copy())</p>