title: Initialization error in list of lists using for loop and direct method
body: <p>I am writing code for concentric rectangle and initializing 'result' variable as,</p>
  <p>[[0 for x in range(array_size)] for y in range(array_size)],</p>
  <p>and I get the right answer. However, when I initialize 'result' variable as [[0]*array_size]*array_size, I get a wrong answer. The rest of my procedure is same for both the cases:</p>
  <pre><code>class Solution:
      def concentric(self, A):
          array_size = 2*A - 1
          result = [[0 for x in range(array_size)]
                   for y in range(array_size)];
                   #[[0]*array_size]*array_size
          
          for i in range(array_size):
              for j in range(array_size):
                  if (abs(i-(array_size//2)) &gt; abs(j-(array_size//2))):
                      result[i][j] = abs(i - array_size//2)+1;
                  else:
                      result[i][j] = abs(j - array_size//2)+1;
          return result
  Solution().concentric(3)
  </code></pre>
  <p>The output looks like this:</p>
  <pre><code>[[3, 3, 3, 3, 3], [3, 2, 2, 2, 3], [3, 2, 1, 2, 3], [3, 2, 2, 2, 3], [3, 3, 3, 3, 3]]
  </code></pre>
  <p>Any suggestion or explanation would be appreciated.</p>