I created a code for picking random musics in a list of musics (music_list
) and adding them to music_queue
. When I execute this code, all the elements of music_list
are deleted and I don't understand why.
print("Music list lenght : " + str(len(music_list)))
if len(music_queue) == 0:
tmp = music_list
while len(tmp) > 0:
music_queue.append(tmp.pop(randint(0,len(tmp) - 1)))
print("Music list lenght : " + str(len(music_list)))