Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. user1 = input("What's your name?")
  2. user2 = input("And your name?")
  3. user1_answer = input("%s, do yo want to choose rock, paper or scissors?" % user1)
  4. user2_answer = input("%s, do you want to choose rock, paper or scissors?" % user2)
  5.  
  6. def compare(a1,a2):
  7. if a1 == a2 :
  8. return("It's a tie")
  9. elif a1 == "scissors":
  10. if a2 == "rock":
  11. return("Rock wins!")
  12. else:
  13. return("Scissors wins!")
  14. elif a1 == "paper":
  15. if a2 == "scissors":
  16. return("Scissors wins!")
  17. else:
  18. return("Paper wins!")
  19. elif a1 == "rock":
  20. if a2 == "paper":
  21. return("Paper wins!")
  22. else:
  23. return("Rock wins")
  24. else:
  25. return("The input is invalid!")
  26.  
  27. print(compare(user1_answer,user2_answer))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement