media player queue most music player software allows users the chance to add songs to playlist upon hitting the play buttonall the songs in the main playlist are played one after the other the sequential playing of the songs can be implemented with queues because the first song to be queued is the first song that is played this aligns with the fifo acronym we shall implement our own playlist queue that plays songs in the fifo manner basicallyour media player queue will only allow for the addition of tracks and way to play all the tracks in the queue in full-blown music playerthreads would be used to improve how the queue is interacted withwhile the music player continues to be used to select the next song to be playedpausedor even stopped the track class will simulate musical trackfrom random import randint class trackdef __init__(selftitle=none)self title title self length randint( each track holds reference to the title of the song and also the length of the song the length is random number between and the random module provides the randint method to enable us generate the random numbers the class represents any mp track or file that contains music the random length of track is used to simulate the number of seconds it takes to play song or track to create few tracks and print out their lengthswe do the followingtrack track("white whistle"track track("butter butter"print(track lengthprint(track lengththe output of the preceding code is as follows your output may be different depending on the random length generated for the two tracks