Use List as a stack: push and pop
L = [] L.append(1) # push onto stack L.append(2) print L L.pop() # pop off stack print L