Deque in Python-question-10

Last Updated :
Discuss
Comments

What will be the output of the following code?


from collections import deque

d = deque([1, 2, 3, 4])

d.extendleft([0, -1])

print(d)

[-1, 0, 1, 2, 3, 4]

[0, -1, 1, 2, 3, 4]

[1, 2, 3, 4, 0, -1]

[-1, 0, 1, 2, 3, 4]

Share your thoughts in the comments