how to add to an empty queue in python code example
Example 1: python get item from queue
"""put and get items from queue"""
>>> from Queue import Queue
>>> q = Queue()
>>> q.put(1)
>>> q.put(2)
>>> q.put(3)
>>> print list(q.queue)
[1, 2, 3]
>>> q.get()
1
>>> print list(q.queue)
[2, 3]
Example 2: py list enqueue
a = [1,2,3,4]
# enqueue
a = [0] + a
>>> [0,1,2,3,4]