title: li.append(i) vs tu = tu + (i,)
body: <p>My question is why storing data in a list and appending each new data point is so much faster than using a tuple and redefining the tuple at every iteration. My code:</p>
  <pre><code>def li(N):
      li = []
      for i in range(N):
          li.append(i)
      return 
  
  def tu(N):
      tu = ()
      for i in range(N):
          tu = tu + (i,)
      return
  </code></pre>
  <p>If I run my functions with N = 100000 li takes 0.02364325523376465 and tu 24.86034870147705.</p>
  <p>Is there a reason for this huge discrepancy in speed?</p>