title: Strings and Nested For Loops in Python
body: <p>I have a problem where I want to have a nested for loop concatenate a string.  For some reason I'm not getting the correct output.  Can someone give me some advice?  This should be simple.</p>
  
  <pre><code>newRow = []
  matrix = []
  for i in range(0,3):
      for j in range(0,5):
          newRow.append(j)
      matrix.append(newRow)
  print matrix
  
  python test.py
  
  [[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4], 
  [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4], 
  [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4]]
  </code></pre>
  
  <p>I want it to print...</p>
  
  <pre><code>[[0, 1, 2, 3, 4],
  [0, 1, 2, 3, 4],
  [0, 1, 2, 3, 4]]
  </code></pre>