摘要: import collections n=5 buffer=collections.deque(maxlen=n) buffer.append('5')#尾端追加 buffer.popleft()#左端删除 buffer.count('5')#统计 print(len(buffer))#长度 if 阅读全文
posted @ 2019-12-28 16:36 重积德 阅读(322) 评论(0) 推荐(0) 编辑