title: Initialize and Populate 2 Dimensional Array in Python from other Lists
body: <p>I want to create 2 dimensional array and populate it with the following information.</p>
  
  <pre><code>n = 7  
  j = [0, 1, 2, 3, 4, 5, 6]  
  k = [0, 2, 4, 3, 3, 2, 1]  
  l = [0 , 46, 52, 30, 36 ,56, 40]  
  </code></pre>
  
  <p>so, the the first list of the List L should b [0,0,0], second list of list L should be [1,2,46], third should of List L should be the list [2, 4, 52] and so on. But its not working and it keep overriding the values</p>
  
  <pre><code>#!/usr/bin/python3.6
  
  from operator import itemgetter
  
  n = 7
  j = [0, 1, 2, 3, 4, 5, 6]
  k = [0, 2, 4, 3, 3, 2, 1]
  l = [0 , 46, 52, 30, 36 ,56, 40]
  
  L =  [[0]*3]*n
  
  print(L)
  
  x = 0
  y = 0
  z = 0
  
  while x &lt; len(j):
    L[x][0] = j[x]
    x =  x + 1
  
  while y &lt; len(k):
    L[y][1] = k[y]
    y  = y + 1
  
  while z &lt; len(l):
    L[z][2] = l[z]
    z  = z + 1
  
  
  print (L)
  </code></pre>
  
  <p>The current output is<br>
  Initialization of L, and thats ok<br>
  [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]  </p>
  
  <p>And L after modification, which is very wrong<br>
  [[6, 1, 40], [6, 1, 40], [6, 1, 40], [6, 1, 40], [6, 1, 40], [6, 1, 40], [6, 1, 40]]  </p>