Skip to content

Instantly share code, notes, and snippets.

@PerroBueno
Last active May 5, 2018 23:41
Show Gist options
  • Save PerroBueno/d965cecc1a0e8ad950ee740c6e4b352f to your computer and use it in GitHub Desktop.
Save PerroBueno/d965cecc1a0e8ad950ee740c6e4b352f to your computer and use it in GitHub Desktop.
Rock Paper Scissors
def rps():
one = input("Player one Choose rock, paper or scissors").lower()
two = input("Player two Choose rock, paper or scissors").lower()
list = ["rock", "scissors", "paper", "rock"]
if (one or two) not in list:
print("fail")
else:
if one == two:
print("draw")
elif (list.index(one) + 1) == (len(list) - 1 - list[::-1].index(two)):
print("player one wins")
else:
print("player two wins")
while True:
rps()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment