Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- make a Rock, Paper, Scissors game and play against the computer.
- You and the computer both choose rock, paper or scissors.
- The winner is decided by these rules:
- Rock blunts scissors
- Paper covers rock
- Scissors cut paper
- """
- from random import randint
- player = input("rock(r), paper(p), or scissors(s)? ")
- print(player, "vs ", end="")
- number = randint(1, 3)
- # print(number)
- if number == 1:
- computer = "r"
- elif number == 2:
- computer = "p"
- else:
- computer = "s"
- print(computer)
- if player == computer:
- print("DRAW!")
- elif player == "r" and computer == "p":
- print("Computer wins")
- elif player == "p" and computer == "s":
- print("Computer wins")
- elif player == "s" and computer == "r":
- print("Computer wins")
- elif player == "p" and computer == "r":
- print("Player wins")
- elif player == "s" and computer == "p":
- print("Player wins")
- elif player == "r" and computer == "s":
- print("Player wins")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement