stack python add remove top bottom code example
Example: python remove bottom element stack
>>> from collections import deque
>>> myStack = deque()
>>> myStack.append('a')
>>> myStack.append('b')
>>> myStack.append('c')
>>> print(myStack)
deque(['a', 'b', 'c'])
>>> myStack.reverse()
>>> print(myStack)
deque(['c', 'b', 'a'])
>>> myStack.pop()
'a'
>>> print(myStack)
deque(['c', 'b'])
>>> myStack.reverse()
>>> print(myStack)
deque(['b', 'c'])