A. deletelasttwo(L): returns a mylist that contains all but the last two elements of L, in same sequence.
From EECS 182
A. deletelasttwo(L): returns a mylist that contains all but the last two elements of L, in same sequence.
- Problem A: Return a list that does not contain the last two items in L
def deletelasttwo(L):
return L.pop().pop()