Collection Methods
collections.deque.extend()
Append each input element to the right; a bound may discard older left-side entries.
Formal Syntax & Structure
python syntaxpython
deque_instance.extend(iterable, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| iterable | iterable | Input 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([1],maxlen=3)d.extend([2,3,4])print(list(d))