Collection Methods

collections.deque.extendleft()

Append each input element individually to the left, reversing its encounter order in the resulting prefix.

Formal Syntax & Structure

python syntaxpython
deque_instance.extendleft(iterable, /)

Parameters & Attributes

NameTypeDescription
iterableiterableInput values, consumed as needed.

Return Value

None

No return value; the operation changes the receiver in place.

Working Example

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