Skip to content

Instantly share code, notes, and snippets.

@vikychoi
Created November 6, 2017 05:05
Show Gist options
  • Save vikychoi/4356b39555977eaaee368856c02b364f to your computer and use it in GitHub Desktop.
Save vikychoi/4356b39555977eaaee368856c02b364f to your computer and use it in GitHub Desktop.
# i will do player vs comp
import random
will = 1
while will == 1:
player = input("rock, paper, scissors")
comp = random.randint(1,3)
if comp ==1:
comp = "rock"
elif comp == 2:
comp = "paper"
else:
comp = "scissors"
print("computer used ",comp)
if player == comp:
print("draw!")
elif player == "rock" and comp == "scissors" or player == "scissors" and comp =="paper" or player == "paper" and comp == "rock":
print("player wins!")
else:
print(" computer wins!")
will = int(input("do you want to leave? dont input 1 to leave"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment