title: Creating arrays with for and while loops - Python 2
body: <p>I have the following program which successfully creates a 10x20 array filled with zeros:</p>
  
  <pre><code>array2 = []
  array2=[[0 for j in range(10)] for i in range(20)]
  print array2
  </code></pre>
  
  <p>I then tried to do the same with a for loop and a while loop:</p>
  
  <pre><code>for j in range(20):
    for i in range(10):
      array1.append(0)
  print array1
  
  array3 = []
  count = 0
  while count &lt;= 20:
    count += 1
    while count &lt;= 10:
      array3.append(0)
      count += 1
  print array3
  </code></pre>
  
  <p>I feel like I am on the right track, but I can not seem to be able to create the same thing with these loops. How can I tweak these loops in order to create the same effect as the first one?
  Thank you.</p>