What are Python's built-in structures for stacks and queues?

Entry Python

Answer

Stack: list with append/pop.
Queue: collections.deque.
queue.Queue for thread-safe queues.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice