title: Strange behavior after growing list of lists
body: <p>The code below results in (for me) highly surprising output:</p>
  
  <pre><code>cols = [ int(x) for x in sys.argv[2:] ]
  
  data = [[]] * len(cols)
  
  with open( sys.argv[1] ) as f:
      for l in f:
          c = l.split()
          if len(c) &lt;= cols[-1]: continue
          for i in range(0,len(cols)):
              print( i, cols[i], c[cols[i]] )
              data[i].append( float(c[cols[i]]) )
          print()
  
  for i in range( 0, len(cols)):
      print( data[i] )
  </code></pre>
  
  <p>Calling this with e.g.:</p>
  
  <pre><code>python3 script.py file.txt 2 3
  </code></pre>
  
  <p>Where 'file.txt' contains:</p>
  
  <pre><code>1       0       0       -21612.9       
  2       0.0914607       0.0914607       -21611.6 
  ...       
  </code></pre>
  
  <p>The output of the first print is as expected like this:</p>
  
  <pre><code>0 2 0
  1 3 -21612.9
  
  0 2 0.0914607
  1 3 -21611.6
  
  ...
  </code></pre>
  
  <p>However the second loop returned two identical lists like this:</p>
  
  <pre><code>[0.0, -21612.9, 0.0914607, -21611.6, ...
  </code></pre>
  
  <p>I expected two lists:</p>
  
  <pre><code>[0.0, 0.0914607, ...
  [-21612.9, -21611.6, ...
  
  </code></pre>
  
  <p>I know that this can be done using e.g. defaultdict, but I would like to understand why that code does not work. I suspect it is the declaration of 'data' as fixed size list of empty lists?</p>