Stack: last in, first out: activity sheet
Goal: Push, pop and peek on a stack built on a Python list and see why the last item in is the first out.
You need: Only the simulation is needed. A pile of books or plates works as a real-world stack.
Safety: No special safety needs.
- Push three items.
- Pop once and see which item leaves.
- Peek and compare with pop.
- Pop until the stack is empty and see the message.
| Operation | Stack after (bottom to top) |
|---|---|
Use your browser's Print option to print this page.