Facebook
From pedro, 4 Years ago, written in Python.
Embed
Download Paste or View Raw
Hits: 124
  1. import os
  2. maos = ["pedra", "papel", "tesoura"]
  3. os.system('cls')#comando limpar terminal
  4.  
  5. play1 = input("Jogador1: Pedra, papel ou tesoura: ")#perguta
  6. while not play1 in maos:#enquanto o que o play2 digita nao estiver em maos , escreva tente novamente
  7.     play1 = input("Voce coloco algo diferente! Tente novamente: ")
  8.  
  9. os.system('cls')
  10. play2 = input("Jogador2: Pedra, papel ou tesoura: ")
  11. while not play2 in maos: #enquanto o que o play2 digita nao estiver em maos , escreva tente novamente
  12.     play2 = input("Voce coloco algo diferente! Tente novamente: ")
  13.  
  14.    
  15. if play1 == "pedra" and play2 == "pedra":
  16.     print("Nenhum 2 ganharam")
  17. elif play1 == "papel" and play2 == "papel":
  18.     print("Nenhum 2 ganharam")
  19. elif play1 == "tesoura" and play2 == "tesoura":
  20.     print("Nenhum 2 ganharam")
  21. elif play1 == "pedra" and play2 == "tesoura":
  22.     print("Jogador 1 ganhou! escolheu: Pedra")
  23. elif play2 == "pedra" and play1 == "tesoura":
  24.     print("Jogador 2 ganhou! escolheu: Pedra")
  25. elif play1 == "papel" and play2 == "pedra":
  26.     print("Jogador 1 ganhou! escolheu: Papel ")
  27. elif play2 == "papel" and play1 == "pedra":
  28.     print("Jogado 2 ganhou!, escolheu: Papel")
  29. elif play1 == "tesoura" and play2 == "papel":
  30.     print("Jogador 1 ganhou! escolheu: tesoura ")
  31. elif play1 == "papel" and play2 == "tesoura":
  32.     print("Jogador 2 ganhou! escolheu: tesoura")
  33.