Deque

it's like List but you have access to

  • popleft()
  • appendleft()
    which makes the code more fluent
from collections import deque

queue = deque() # empty queue
queue = deque([1,3,5]) # queue from list