title: Python recursion in appending lists
body: <p>I want to append to a list recursively but I cannot come up with a function that works. The function takes two arguments <code>times</code> and <code>data</code>. <code>times</code> should be the number of times to append the data.</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>def replicate_recur(times, data):
      result2 = []
      if times == 0:
          result2.append(data)
      else:
          result2.append(data)
          replicate_recur(times - 1, data)
      return result2
  </code></pre>