Hello, I was studying Python Code Cahallenges :Lists
The question is below:
Write a function named
append_sumthat has one parameter — a list named named
The function should add the last two elements of
lsttogether and append the result to
lst. It should do this process > three times and then return
For example, if
[1, 1, 2], the final result should be
[1, 1, 2, 3, 5, 8].
My solution code is below:
def append_sum(lst): for i in range(3): a = int(lst[-2]) + int(lst[-1]) b = lst.append(a) return b
But this code snippet returns “None”. Why?