fork download
  1. import random
  2. import time
  3.  
  4. playlist=["a","b","c","d","e"]
  5. played_songs=[]
  6.  
  7. while True:
  8. song=random.choice(playlist)
  9.  
  10. if song not in played_songs:
  11. print(song,end="")
  12. for i in range(3):
  13. time.sleep(0.25)
  14. print(".",end="")
  15. print()
  16. played_songs+=song
  17.  
  18. elif len(playlist)==len(played_songs):
  19. break
  20.  
Success #stdin #stdout 0.03s 9912KB
stdin
Standard input is empty
stdout
d...
a...
c...
e...
b...