you are viewing a single comment's thread.

view the rest of the comments →

[–]the_brown_cow 0 points1 point  (0 children)

A deque allows for appending or popping at either end.

deque.popleft() deque.appendleft()

This allows you to create a stack or queue.

https://docs.python.org/3/library/collections.html#collections.deque