I wanted to append the last two items of “lst” on to the end of lst. My code does this but puts the last to items in a sub-list. Why is it doing this?
#Write your function here def append_sum(lst): lst.append(lst[-2:]) return lst #Uncomment the line below when your function is done print(append_sum([1, 1, 2]))
[1, 1, 2, [1, 2]]