Question DSA-QUE-0032
EasyWhat is the output of this code?
from collections import deque
q = deque([1, 2, 3])
q.appendleft(0)
q.pop()
print(list(q))
- A.
[1, 2, 3]
- B.
[1, 2]
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Queues and Deques question
What is the output of this code?
from collections import deque
q = deque([1, 2, 3])
q.appendleft(0)
q.pop()
print(list(q))
[1, 2, 3]
[1, 2]
Sign up free to see the answer and a step-by-step explanation.
[0, 1, 2, 3]
[0, 1, 2]