Python - Stack

About

To implement a stack, you use a list in Python

Example

stack = [3, 4, 5]
stack.append(6)
stack.append(7)
stack
[3, 4, 5, 6, 7]
stack.pop()
7
stack
[3, 4, 5, 6]
stack.pop()
6
stack.pop()
[3, 4]

Documentation / Reference


Powered by ComboStrap