Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ROCK PAPER SCISSORS GAME
- #CodedSkills.net 1337Tutorials.net
- import random
- while True:
- choices = ["rock","paper","scissors"]
- computer = random.choice(choices)
- player = None
- while player not in choices:
- player = input("rock, paper, or scissors?: ").lower()
- if player == computer:
- print("computer: ",computer)
- print("player: ",player)
- print("Tie!")
- elif player == "rock":
- if computer == "paper":
- print("computer: ",computer)
- print("player: ",player)
- print("You lose!")
- if computer == "scissors":
- print("computer: ",computer)
- print("player: ",player)
- print("You win!")
- elif player == "scissors":
- if computer == "rock":
- print("computer: ",computer)
- print("player: ",player)
- print("You lose!")
- if computer == "paper":
- print("computer: ",computer)
- print("player: ",player)
- print("You win!")
- elif player == "paper":
- if computer == "scissors":
- print("computer: ",computer)
- print("player: ",player)
- print("You lose!")
- if computer == "rock":
- print("computer: ",computer)
- print("player: ",player)
- print("You win!")
- play_again = input("Play again? (y/n): ").lower()
- if play_again != "y":
- break
- print("Bye!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement