deque

基本用法

from collections import deque

a = deque()
for i in range(5):
    a.append(i)
print(a)
a.appendleft(5)
print(a)
a.pop()
print(a)
a.popleft()
print(a)
print(len(a))

 

posted @ 2019-07-09 12:15  xd_xumaomao  阅读(56)  评论(0编辑  收藏  举报