Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Rock, Paper, Scissors")
- def rps():
- userInput = input("Please enter your choice: ")
- userInput = userInput.lower()
- if userInput != 'rock' and userInput != 'paper' and userInput != 'scissors':
- print("Your choice is invalid")
- import random
- computerChoice = ''
- for x in range(1):
- num = random.randint(1,4)
- if num == 1:
- computerChoice = 'rock'
- elif num == 2:
- computerChoice = 'paper'
- elif num == 4:
- computerChoice = 'scissors'
- if userInput == computerChoice:
- print("DRAW!")
- elif userInput == 'rock' and computerChoice == 'paper':
- print("COMPUTER WINS!")
- elif userInput == 'rock' and computerChoice == 'scissors':
- print('USER WINS!')
- elif userInput == 'paper' and computerChoice == 'rock':
- print("USER WINS!")
- elif userInput == 'paper' and computerChoice == 'scissors':
- print("COMPUTER WINS!")
- elif userInput == 'scissors' and computerChoice == 'rock':
- print("COMPUTER WINS!")
- elif userInput == 'scissors' and computerChoice == 'paper':
- print("USER WINS!")
- print("Would you like to try again?")
- try_again = input("Y/N ")
- try_again = try_again.lower()
- if try_again == "y":
- print("n")
- rps()
- else:
- print("n")
- print("Thank you for using my Rock, Paper, Scissors Program")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement