title: How to create a 2D list in python where all elements are the same?
body: <p>I want to create a <code>n x n</code> 2D list of lists in python, where all elements are equal to <code>False</code>. So I tried this:</p>
  
  <pre><code>array = [[False] * n] * n
  </code></pre>
  
  <p>This appears to give me what I want, but if I want to change an element in the <code>(i, j)</code> position, say:</p>
  
  <pre><code>array[i][j] = not array[i][j]
  </code></pre>
  
  <p>this changes all the elements in the j<sup>th</sup> column, rather than just affecting <code>(i, j)</code> position. I realize this is because all the rows in the list are just referencing the first row.</p>
  
  <p>Is there a non verbose way in vanilla python (no numpy) to create a 2D list of lists without the internal referencing (is that what it's called) ?</p>