# -*- coding: utf-8 -*-
from collections import deque
q = deque([1,2,3,4,5], 5)
q.append(6) # 队尾进队
print(q.popleft()) # 队首出队
# 用于双向队列
q.appendleft(1) # 队首进队
q.pop() # 队尾出队
标签:deque,队尾,队列,进队,--,双向
From: https://www.cnblogs.com/zylyehuo/p/17637351.html