title: Python: append copy of nested list to list
body: <p>In my code, I have the nested list <code>gamelist</code>, defined as</p>
  
  <pre><code>gamelist = [['3'], ['2'], ['1']]
  </code></pre>
  
  <p>The purpose of the program is to treat the internal lists as stacks, appending smaller elements to stacks containing larger elements or empty stacks, sweeping up and down the list and not repeating moves. Theoretically this game should go:</p>
  
  <pre><code>[['3'], ['2'], ['1']]
  [['3'], ['2', '1'], []]
  [['3', '1'], ['2'], []]
  [['3', '1'], [], ['2']]
  </code></pre>
  
  <p>And so on, until the list is sorted from smallest to largest.</p>
  
  <p>In order to check the current move against previous moves, I created <code>pastmoves</code>, which has a copy of <code>gamelist</code> appended to it after each move.</p>
  
  <pre><code>pastmoves.append(gamelist[:])
  </code></pre>
  
  <p>So <code>pastmoves</code> should read</p>
  
  <pre><code>[[['3'], ['2'], ['1']]]
  [[['3'], ['2'], ['1'], [['3'], ['2', '1'], []]]
  </code></pre>
  
  <p>and so on after each consecutive move.</p>
  
  <p>My issue is that while gamelist is being copied, the lists nested inside it are not, and <code>pastmoves</code> looks like this after two moves:</p>
  
  <pre><code>[[['3'], ['2', '1'], []], [['3'], ['2', '1'], []]]
  </code></pre>
  
  <p>I'd like to make it so that all of the bottom-level values are also copies and remain static as <code>gamelist</code> changes. How can I achieve that?</p>