Using .append() With Deques in Python
It allows for enqueuing and dequeuing off either end of the queue. It’s pronounced “deck.” Calling it “de-queue” would create some confusion with the operation dequeue, so you say “deck.” You can perform the operations using
.append() to dequeue and enqueue off the right-hand side and
.appendleft() to dequeue and enqueue off the left-hand side.
00:39 Its initializer takes two optional arguments: an initial queue and the maximum size of the queue, should you want one. Knowing how to create one and what its operations are, using it is like you would expect. First, import the class.
Become a Member to join the conversation.