Advertisement
JkSoftware

Day 4 - Rock Paper Scissors

Nov 8th, 2021
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. import random
  2.  
  3. scissors = "scissors"
  4. rock = "rock"
  5. paper = "paper"
  6. userplay = input("============================================Rock, Paper, Scissors============================================\n1 = Rock.   2 = Paper.  3 = Scissors")
  7. gameplay = [rock, paper, scissors]
  8. chance = random.randint(0, 2)
  9. computerplay = gameplay[chance]
  10. if userplay == rock:
  11.     if computerplay == scissors:
  12.         print(f"Computer chose {computerplay}, You Win!")
  13. if userplay == paper:
  14.     if computerplay == rock:
  15.         print(f"Computer chose {computerplay}, You Win!")
  16. if userplay == scissors:
  17.     if computerplay == paper:
  18.         print(f"Computer chose {computerplay}, You Win!")
  19. else:
  20.     print(f"Computer chose {computerplay}, You Lose :(")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement