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]))
this prints [1, 1, 2, 3, 5, 8] but how do I do it N times?
And what is this "codes" actually called in coding? (I'm referring to the code that is in the function)