Skip to Content
Stacks: Python
Stacks Python Review

Nice work — you’ve built out a Stack class that can:

  • add a new item to the top via a push() method
  • remove an item from the top and returns its value with a pop() method
  • return the value of the top item using a peek() method
  • allows a stack instance to maintain an awareness of its size to prevent stack “overflow”

So how does your code stack up against pizza delivery?



Uncomment the push() and pop() statements at the bottom of your code to see your Stack class help a pizza delivery place efficiently manage delivering a stack of pizzas.

Folder Icon

Sign up to start coding

Already have an account?