SHARE
TWEET

Untitled

a guest Jul 16th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2.  
  3. alegere_pc = random.randint(1,3)
  4.  
  5.  
  6. # PENTRU A SALVA CODUL, INTRATI PE PASTEBIN.COM
  7. #
  8. #legenda
  9. #piatra = 1
  10. #hartie = 2
  11. #foarfeca = 3
  12.  
  13. def rockpaperscissors():
  14.     alegere = input("Piatra, Hartie, Foarfeca? ")
  15.    
  16.     if alegere == "piatra":
  17.         if alegere_pc == 1:
  18.             print("draw")
  19.         elif alegere_pc == 2:
  20.             print("lose")
  21.         else
  22.             print("win")
  23.     elif alegere == "hartie":
  24.         if alegere_pc == 1:
  25.             print("win")
  26.         elif alegere_pc == 2:
  27.             print("draw")
  28.         else
  29.             print("lose")
  30.     elif alegere == "foarfeca":
  31.         if alegere_pc == 1:
  32.             print("lose")
  33.         elif alegere_pc == 2:
  34.             print("win")
  35.         else
  36.             print("draw")
  37.     else:
  38.         print("Ce zici ma?")
  39.  
  40. rockpaperscissors()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top