they have strict ordering of elements they support the append operation efficiently they tend to be slowhoweverif you are inserting elements anywhere but the end of the list (especially so if it' the beginning of the listas we discussed in the section on setsthey are also slow for checking if an element exists in the listand by extensionsearching storing data in sorted order or reordering the data can also be inefficient let' look at the three types of containers provided by the python queue module fifo queues fifo stands for first in first out and represents the most commonly understood definition of the word "queueimagine line of people standing in line at bank or cash register the first person to enter the line gets served firstthe second person in line gets served secondand if new person desires servicethey join the end of the line and wait their turn the python queue class is just like that it is typically used as sort of communication medium when one or more objects is producing data and one or more other objects is consuming the data in some wayprobably at different rate think of messaging application that is receiving messages from the networkbut can only display one message at time to the user the other messages can be buffered in queue in the order they are received fifo queues are utilized lot in such concurrent applications (we'll talk more about concurrency in testing object-oriented programs the queue class is good choice when you don' need to access any data inside the data structure except the next object to be consumed using list for this would be less efficient because under the hoodinserting data at (or removing fromthe beginning of list can require shifting every other element in the list queues have very simple api queue can have "infinite(until the computer runs out of memorycapacitybut it is more commonly bounded to some maximum size the primary methods are put(and get()which add an element to the back of the lineas it wereand retrieve them from the frontin order both of these methods accept optional arguments to govern what happens if the operation cannot successfully complete because the queue is either empty (can' getor full (can' putthe default behavior is to block or idly wait until the queue object has data or room available to complete the operation you can have it raise exceptions instead by passing the block=false parameter or you can have it wait defined amount of time before raising an exception by passing timeout parameter