import queue
q = queue.PriorityQueue()
q.put((-1,"chenronghua"))
q.put((3,"hanyang"))
q.put((2,"alex"))
q.put((6,"wangsen"))
print(q.get())
print(q.get())
print(q.get())
print(q.get())
# q = queue.LifoQueue()
#
# q.put(1)
# q.put(2)
# q.put(3)
# print(q.get())
# print(q.get())
# print(q.get())
python queue队列
最新推荐文章于 2022-07-08 21:31:12 发布