Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. from random import randint
  2.  
  3. #create a list of options for players
  4. o = ["rock", "paper", "scissors"]
  5.  
  6. #assign a random choice of option for the computer to play
  7. c = o[randint(0,2)]
  8.  
  9. #set player to False
  10. player = False
  11.  
  12. #create loop to play the game
  13. while player == False:
  14. player = input("Please type in your play: rock, paper, scissors? ")
  15. if player == c:
  16. print("<><><><> We have a tie! <><><><>")
  17. elif player == "rock":
  18. if c == "paper":
  19. print("xxxxx Loss -", c, "covers your", player, "xxxxx")
  20. else:
  21. print("!!!!!! Your the winner!", player, "crushes the", c, "!!!!!!")
  22. elif player == "paper":
  23. if c == "scissors":
  24. print("xxxxx Loss -", c, "cuts your", player, "xxxxx")
  25. else:
  26. print("!!!!!! Your the winner!", player, "covers the", c, "!!!!!!")
  27. elif player == "scissors":
  28. if c == "rock":
  29. print("xxxxx Loss -", c, "crushes your", player, "xxxxx")
  30. else:
  31. print("!!!!!! Your the winner!", player, "cuts the", c, "!!!!!!")
  32. else:
  33. print("Please enter a valid choice to play!")
  34. #player is set to True, but must be set to False to continue the loop
  35. player = False
  36. c = o[randint(0,2)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement