Last active
May 5, 2018 23:41
-
-
Save PerroBueno/d965cecc1a0e8ad950ee740c6e4b352f to your computer and use it in GitHub Desktop.
Rock Paper Scissors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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