python class queue code example
Example 1: queue python
from queue import Queue
q = Queue()
q.size() # returns the current lenght of queue
q.empty() # returns True if empty, False otherwise
q.put(item)
q.get()
Example 2: py list enqueue
a = [1,2,3,4]
# enqueue
a = [0] + a
>>> [0,1,2,3,4]