Collection Methods

collections.deque.pop()

Remove and return the rightmost item; raise IndexError when empty.

Formal Syntax & Structure

python syntaxpython
deque_instance.pop()

Return Value

object

The object result described above.

Working Example

Example Snippetpython
import collectionsd=collections.deque([1,2])print((d.pop(),list(d)))
Python Reference