摘要:
mylist = [0,1,1,2,2,3,3,3,3,4,5,6,7,7,8,8,9,10,10,11,22,33,22] from collections import Counter c = Counter() for i in mylist: c[i] = c[i] +1 print(c) 阅读全文
摘要:
import queue q = queue.Queue(3)# 指定队列大小,如果为空则为无限大 print(q.empty()) q.put('厉智') q.put('程劲') q.put('陈培昌') print(q.full()) for i in range(q.qsize()): print(q.get()) print(q.full()) 阅读全文
摘要:
from collections import deque mydquene = deque() mylist = [0,1,1,2,2,3,3,3,3,4,5,6,7,7,8,8,9,10,10,11,22,33,22] mydquene.extend(mylist) for i in set(mylist): n = mydquene.count(i) if ... 阅读全文