How to use list in Python as stack?

Question

How to use list in Python as stack?

Re: How to use list in Python as stack?

his is very easy implementation of LIFO stack.
>> stack = [1, 2, 3]
>>> stack.append(4)
>>> stack.append(5)
>>> stack
[1, 2, 3, 4]
>>> stack.pop()
7
Pop takes the last argument that is on the stack.