Answers for "how to declare emtpy stack in python"

4

python stack data structure

>>> from collections import deque
>>> myStack = deque()
>>> myStack.append('a')
>>> myStack.append('b')
>>> myStack.append('c')
>>> myStack
deque(['a', 'b', 'c'])
>>> myStack.pop()
'c'
>>> myStack
deque(['a', 'b'])
Posted by: Guest on August-13-2020

Code answers related to "how to declare emtpy stack in python"

Python Answers by Framework

Browse Popular Code Answers by Language