Create queue
import queue q = queue.Queue()
empty (if the queue is empty, return True)
##
import queue q = queue.Queue()print(q.empty())#输出:True
import queue q = queue.Queue(1) #指定队列大小q.put('a')print(q.full())#输出:True
import queue q = queue.Queue() q.put('a') q.put('b')print(q.get())#输出:a
#占位
#占位
#占位
import queue q = queue.Queue() q.put('a') q.put('b')print(q.qsize())#输出:2
#占位
The above is the detailed content of Detailed introduction to python3 Queue (one-way queue). For more information, please follow other related articles on the PHP Chinese website!