Question DSA-QUE-0011
MediumWhat is the output of this code?
from collections import deque
d = deque()
for x in [1, 2, 3]:
d.appendleft(x)
print(list(d))
- A.
[1, 3, 2]
- B.
[1, 2, 3]
- C.
[3, 2, 1]
- D.
[2, 3, 1]
Sign up free to see the answer and a step-by-step explanation.