Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. from random import randint
  2. choices = ["rock", "paper", "scissors"]
  3. print("Step right up for a game of " + choices[0]+ " " + choices[1] + " " + choices[2])
  4. #player 1 select
  5. select = input("pick one [Rock, Paper, Scissors]:").lower()
  6. #pc select
  7. aiChoice = choices[randint(0,2)]
  8. #error check
  9. if select != "rock" and select != "paper" and select != "scissors":
  10.     print(select + " is not a valid option. Get outta here!")
  11.     quit()
  12. else:
  13.     choice = choices[choices.index(select)]  
  14. print("Player 1 chooses: " + choice + " - AI chooses: " + aiChoice)
  15. #determine winner
  16. if choice == aiChoice:
  17.     print("It's a draw! Dagnabbit.")
  18. elif choice == choices[0] and aiChoice == choices[1] or choice == choices[1] and aiChoice == choices[2] or choice == choices[2] and aiChoice == choices[0]:
  19.     print("No dice! You lose.")
  20. else:
  21.     print("You win this round, pardner")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement