title: how do I repeat the codes in the function N times instead of re-typing it?
body: <pre><code>def append_sum(lst):
    new_num = (lst[-1]+lst[-2])
    lst.append(new_num)
    new_num1 = (lst[-1]+lst[-2])
    lst.append(new_num1)
    new_num2 = (lst[-1]+lst[-2])
    lst.append(new_num2)
    return lst
  
  print(append_sum([1, 1, 2]))
  </code></pre>
  <p>this prints [1, 1, 2, 3, 5, 8]  but how do I do it N times?</p>
  <p>And what is this &quot;codes&quot; actually called in coding? (I'm referring to the code that is in the function)</p>