Concept

Mimicking Stacks with Lists

Lists can be used as stacks by using append() to add an item to the top, and pop() without an index to retrieve the element from the top.

Example:

Image 0

0

1

Updated 2021-06-01

Tags

Python Programming Language

Data Science