-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex045.py
More file actions
29 lines (28 loc) · 919 Bytes
/
Copy pathex045.py
File metadata and controls
29 lines (28 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from random import choice
lista = ['Pedra', 'Papel', 'Tesoura']
comp = choice(lista)
print('Opções:\n1-{}\n2-{}\n3-{}'.format(lista[0], lista[1], lista[2]))
jog = int(input('Escolha: '))
if 1 <= jog <= 3:
jogador = lista[jog-1]
print('Computador escolheu: {}'.format(comp))
print('Você escolheu: {}'.format(jogador))
if comp == jogador:
print('Empate')
elif comp == lista[0]: # Pedra
if jogador == lista[2]: # Tesoura
print('O Computador ganhou!')
else:
print('Você ganhou!')
elif comp == lista[2]: # Tesoura
if jogador == lista[1]: # Papel
print('O Computador ganhou!')
else:
print('Você ganhou!')
elif comp == lista[1]: # Papel
if jogador == lista[0]: # Pedra
print('O Computador ganhou!')
else:
print('Você Ganhou!')
else:
print('Opção invalida')