Question DSA-QUE-0003
EasyWhat is the output of this code?
from collections import deque
q = deque()
q.append(1)
q.append(2)
q.append(3)
print(q.popleft())
- A.
[2, 3]
- B.
2
- C.
Show answer and explanation
Answer: C
popleft() removes the element at the front, the first one added.