Method Name:
extendleft
Method Signature:
extendleft(iterable)
Method Overview:
Example:
import collections
multiples = (0, -10, -20)
# Create a deque instance from a tuple of two elements dequeInstance = collections.deque((10, 20)) print("Initial deque:") print(dequeInstance)
# Extend the deque on the left side using a tuple print("Deque after exetending it on the left side:") dequeInstance.extendleft(multiples) print(dequeInstance) |
Output:
Initial deque: deque([10, 20]) Deque after exetending it on the left side: deque([-20, -10, 0, 10, 20]) |