title: What is the fastest way to merge two lists in python?
body: <p>Given,</p>
  <pre><code>list_1 = [1,2,3,4]
  list_2 = [5,6,7,8]
  </code></pre>
  <p>What is the <strong>fastest way</strong> to achieve the following in python?</p>
  <pre><code>list = [1,2,3,4,5,6,7,8]
  </code></pre>
  <p>Please note that there can be many ways to merge two lists in python.<br />
  I am looking for the most time-efficient way.</p>
  <p>I tried the following and here is my understanding.</p>
  <p>CODE</p>
  <pre><code>import time
  
  c = list(range(1,10000000))
  c_n = list(range(10000000, 20000000))
  
  start = time.time()
  c = c+c_n
  print len(c)
  print time.time() - start
  
  c = list(range(1,10000000))
  start = time.time()
  for i in c_n:
      c.append(i)
  print len(c)
  print time.time() - start
  
  c = list(range(1,10000000))
  start = time.time()
  c.extend(c_n)
  print len(c)
  print time.time() - start
  </code></pre>
  <p>OUTPUT</p>
  <pre><code>19999999
  0.125061035156
  19999999
  1.02858018875
  19999999
  0.03928399086
  </code></pre>
  <p>So, if someone does not bother reusing list_1/list_2 in the question then <strong>extend</strong> is the way to go. On the other hand, <strong>&quot;+&quot;</strong> is the fastest way.</p>
  <p>I am not sure about other options though.</p>