TheSTRIG

giveaway

Jul 28th, 2021
727
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. import time
  3.  
  4. participants = []
  5. i=1
  6. while i > 0:
  7.     name = input("Enter participant: ")
  8.     participants.append(name)
  9.     if name == "start":
  10.         participants.remove("start")
  11.         break
  12.     i += 1
  13. print("The raffle is starting!")
  14. print("These are our participants: ")
  15. clean_list = list(dict.fromkeys(participants))
  16. print(clean_list)
  17. participants_number = len(clean_list)
  18. while participants_number > 1:
  19.     time.sleep(3)
  20.     unlucky = random.randrange(0, participants_number)
  21.     print("Oof! Sorry " + clean_list[unlucky] + ", better luck next time!")
  22.     clean_list.pop(unlucky)
  23.     participants_number -= 1
  24. print("The winner is: " + clean_list[0] + "!")
RAW Paste Data