Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- choices = ["rock", "paper", "scissors"]
- print("Step right up for a game of " + choices[0]+ " " + choices[1] + " " + choices[2])
- #player 1 select
- select = input("pick one [Rock, Paper, Scissors]:").lower()
- #pc select
- aiChoice = choices[randint(0,2)]
- #error check
- if select != "rock" and select != "paper" and select != "scissors":
- print(select + " is not a valid option. Get outta here!")
- quit()
- else:
- choice = choices[choices.index(select)]
- print("Player 1 chooses: " + choice + " - AI chooses: " + aiChoice)
- #determine winner
- if choice == aiChoice:
- print("It's a draw! Dagnabbit.")
- elif choice == choices[0] and aiChoice == choices[1] or choice == choices[1] and aiChoice == choices[2] or choice == choices[2] and aiChoice == choices[0]:
- print("No dice! You lose.")
- else:
- print("You win this round, pardner")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement