myqueue put( myqueue put( print(myqueue full()input("press any key when ready "myqueue put( print(myqueue full()input("press any key when ready "print(myqueue get()print(myqueue empty()print(myqueue full()input("press any key when ready "print(myqueue get()print(myqueue get()to create queueyou must import the queue module this module actually contains number of queue typesbut this example uses only the standard fifo queue when queue is emptythe empty(function returns true likewisewhen queue is fullthe full(function returns true by testing the state of empty(and full()you can determine whether you need to perform additional work with the queue or whether you can add other information to it these two functions help you manage queue it' not possible to iterate through queue using for loop as you have done with other collection typesso you must monitor empty(and full(instead the two functions used to work with data in queue are put()which adds new dataand get()which removes data problem with queues is that if you try to put more items into the queue than it can holdit simply waits until space is available to hold it unless you're using multithreaded application (one that uses individual threads of execution to perform more than one task at one time)this state could end up freezing your application choose runrun module you see python shell window open the application tests the state of the queue in this caseyou see an output of truewhich means that the queue is empty press enter the application adds two new values to the queue in doing sothe queue is no longer emptyas shown in figure -