Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- u1 = raw_input("Player one:" + "\n"
- "Rock, paper or scissors?" + "\n"
- "Press 'r' for rock," + "\n"
- "Press 'p' for paper," + "\n"
- "Press 's' for scissors:")
- u2 = raw_input("Player two:" + "\n"
- "Rock, paper or scissors?" + "\n"
- "Press 'r' for rock," + "\n"
- "Press 'p' for paper," + "\n"
- "Press 's' for scissors:")
- def compare(p1,p2):
- if p1 == p2:
- return "Its tie!"
- elif p1 == "r":
- if p2 == "s":
- return ("Rock beats scissors! You win player one!")
- else:
- return("paper beats rock! You win player two!")
- elif p1 == "p":
- if p2 =="r":
- return ("Paper beats rock! You win player 2!")
- else:
- return("Scissors beats paper! You win player 2!")
- elif p1 == "s":
- if p2 == "p":
- return ("Scissors beat paper! You win player 1!")
- else:
- return("Rock beats Scissors! You win player 2!")
- else:
- return ("Invalid selection. Please choose 'r' , 'p' or 's'")
- print compare(u1,u2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement