Queue in Python

February 24, 2019
from collections import deque
q = deque([1, 2, 3]) # initialize
q.append(4)

q.popleft() # 1
q.popleft() # 2
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.