title: Best and/or fastest way to create lists in python
body: <p>In python, as far as I know, there are at least 3 to 4 ways to create and initialize lists of a given size:</p>
  
  <p><strong>Simple loop with <code>append</code>:</strong></p>
  
  <pre><code>my_list = []
  for i in range(50):
      my_list.append(0)
  </code></pre>
  
  <p><strong>Simple loop with <code>+=</code>:</strong></p>
  
  <pre><code>my_list = []
  for i in range(50):
      my_list += [0]
  </code></pre>
  
  <p><strong>List comprehension:</strong></p>
  
  <pre><code>my_list = [0 for i in range(50)]
  </code></pre>
  
  <p><strong>List and integer multiplication:</strong></p>
  
  <pre><code>my_list = [0] * 50
  </code></pre>
  
  <p>In these examples I don't think there would be any performance difference given that the lists have only 50 elements, but what if I need a list of a million elements? Would the use of <code>xrange</code> make any improvement? Which is the preferred/fastest way to create and initialize lists in python?</p>