title: Having trouble in creating 2D array/list
body: <p>I'm having difficulty creating a 2D list of permutations. Here is a minimal code to reproduce the problem</p>
  
  <pre><code>class Solution:
  def permute(self, A):
      A = sorted(A)
      print A
      A_out = []
      A_out.append(A)
      for iter0 in range(4):
          A[0] = A[0] + 1
          print A
          A_out.append(A)
      return A_out
  
  sol = Solution()
  A = [1, 2, 3]
  print sol.permute(A)
  </code></pre>
  
  <p>For this particular input(1, 2, 3) the output is</p>
  
  <pre><code>[1, 2, 3]
  [2, 2, 3]
  [3, 2, 3]
  [4, 2, 3]
  [5, 2, 3]
  [[5, 2, 3], [5, 2, 3], [5, 2, 3], [5, 2, 3], [5, 2, 3]]
  </code></pre>
  
  <p>but the desired output is</p>
  
  <pre><code>[1, 2, 3]
  [2, 2, 3]
  [3, 2, 3]
  [4, 2, 3]
  [5, 2, 3]
  [[1, 2, 3], [2, 2, 3], [3, 2, 3], [4, 2, 3], [5, 2, 3]]
  </code></pre>
  
  <p>I think it has something to do deep copy/ shallow copy thing but I am not sure how to correct this as I am not very familiar with Python. How can I fix it?</p>