I am writing to ask you, I have my code that plays songs randomly when you press a button, but how can I make the songs not repeat themselves and when one ends, the next starts?
def play_music():
songs = ("sonidos/playlist/cant toch this.mp3",
"sonidos/playlist/hey song.mp3",
"sonidos/playlist/i like to move it.mp3",
"sonidos/playlist/lets go.mp3",
"sonidos/playlist/little bit.mp3",
"sonidos/playlist/ohohoho.mp3",
"sonidos/playlist/pump it up.mp3",
"sonidos/playlist/pump up the jum.mp3",
"sonidos/playlist/seven nation army.mp3",
"sonidos/playlist/ready for this.mp3",
"sonidos/playlist/seven nation army.mp3",
"sonidos/playlist/usher yeah.mp3",
"sonidos/playlist/what is love.mp3")
selected_song = random.choice(songs)
pygame.mixer.music.load(selected_song)
pygame.mixer.music.play()