nowlet' create our queue using inheritancewe simply inherit from the queue classimport time class mediaplayerqueue(queue)def __init__(self)super(mediaplayerqueueself__init__( call is made to properly initialize the queue by making call to super this class is essentially queue that holds number of track objects in queue to add tracks to the queuean add_track method is createddef add_track(selftrack)self enqueue(trackthe method passes track object to the enqueue method of the queue super class this willin effectcreate node using the track object (as the node' dataand point either the tailif the queue is not emptyor both head and tailif the queue is emptyto this new node assuming the tracks in the queue are played sequentially from the first track added to the last (fifo)then the play function has to loop through the elements in the queuedef play(self)while self count current_track_node self dequeue(print("now playing {}format(current_track_node data title)time sleep(current_track_node data lengthself count keeps count of when track is added to our queue and when tracks have been dequeued if the queue is not emptya call to the dequeue method will return the node (which houses the track objectat the front of the queue the print statement then accesses the title of the track through the data attribute of the node to further simulate the playing of trackthe time sleep(method halts program execution till the number of seconds of the track has elapsedtime sleep(current_track_node data length