🔬 Computer science · Class 12 · virtual lab
Stack: last in, first out
Goal: Push, pop and peek on a stack built on a Python list and see why the last item in is the first out.
- Predict
- Try
- Observe
- Record
- Explain
- Check
Loading the lab…
About this lab
Behind the experiment.
What this lab simplifies
- The stack holds at most six items so overflow can be shown.
- Items are numbers pushed in order 1, 2, 3 and so on.
- A real Python list has no fixed size; the limit is only for the lesson.
Chapters that use this lab (1)
No screen? Use paper.
The activity sheet has the same steps, a results table and the questions, ready to print.