Advertisement
Maszi

papier, kamien, nozyce

Nov 24th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. #   0 - kamień         #       -> komentarz jednolinijkowy
  2. """ 1 - papier      """ """ -> komentarz wielolinijkowy
  3.     2 - nozyce"""
  4.  
  5. print("Wybiera gracz 1: ")
  6. p1 = int(input(" [0] - kamień \n [1] - papier \n [2] - nożyce\n"))
  7.  
  8. print("Wybiera gracz 2: ")
  9. p2 = int(input(" [0] - kamień \n [1] - papier \n [2] - nożyce\n"))
  10. if(p1 >= 0 and p1 <= 2) and (p2 == 0 or p2 == 1 or p2 == 2):
  11.     if p1 == 0 and p2 == 0 or p1 == 1 and p2 == 1 or p1 == 2 and p2 == 2:
  12.         print("Remis")
  13.     elif p1 == 0 and p2 == 2 or p1 == 1 and p2 == 0 or p1 == 2 and p2 == 1:
  14.         print("Wygrywa gracz 1 :)")
  15.     else:
  16.         print("Wygrywa gracz 2 :)")
  17. else:
  18.     print("Niepoprawne dane :(")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement