Last active
July 3, 2017 19:08
-
-
Save Nickikku/de888819a67108897404f273b0847bad 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
Created on Mon Jul 3 15:15:26 2017 | |
@author: nickikku | |
""" | |
print("Let\'s play the game: \'rock, paper, scissors\'") | |
g = 10 | |
a = input("player one, please enter your name: ") | |
b = input("player two, please enter your name: ") | |
while g > 0: | |
print(str(g) + (" games left")) | |
c = input(a +", enter your choice: ") | |
d = input(b + ", enter your choice: ") | |
c = c.lower() | |
d = d.lower() | |
if c == "exit" or d == "exit": | |
break | |
if "rock" in c or "paper" in c or "scissors" in c: | |
print("At least your input is right") | |
else: | |
print("Wrong input..") | |
if "rock" in d or "paper" in d or "scissors" in d: | |
print("At least your input is right") | |
else: | |
print("Wrong input..") | |
if c == "rock" and d == "scissors": | |
print("Player one wins!") | |
break | |
elif d == "rock" and d == "scissors": | |
print("Player two wins!") | |
break | |
elif c == "scissors" and d == "paper": | |
print("Player one wins!") | |
break | |
elif d == "scissors" and d == "paper": | |
print("Player two wins!") | |
break | |
elif c == "paper" and d == "rock": | |
print("Player one wins!") | |
break | |
elif d == "paper" and d == "rock": | |
print("Player two wins!") | |
break | |
else: | |
print("no one wins...") | |
g -= 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment