-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesafio45.py
More file actions
35 lines (35 loc) · 1.36 KB
/
desafio45.py
File metadata and controls
35 lines (35 loc) · 1.36 KB
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
29
30
31
32
33
34
35
from time import sleep
from random import choice
print('\033[30m{} DESAFIO 45 {}\033[m\n'.format('='*10, '='*10))
sleep(1)
print('\033[31m-\033[30m=\033[m'*5, end='')
sleep(1)
print(' \033[36mJO\033[31m-\033[m', end='')
sleep(1)
print('\033[35mKEN\033[31m-\033[m', end='')
sleep(1)
print('\033[33mPÔ\033[30m!\033[m ', end='')
sleep(1)
print('\033[30m=\033[31m-\033[m'*5)
sleep(1)
lista = ['Pedra', 'Papel', 'Tesoura']
resp = str(input('\nTente ganhar do computador! \nEscolha: pedra, papel ou tesoura?\n')).strip().title()
comp = choice(lista)
print(comp)
if comp == resp:
print('\033[33mHouve um EMPATE! Hahaha, tente de novo!\033[m')
elif comp != resp:
if comp == 'Pedra' and resp == 'Tesoura':
print('\033[31mVocê PERDEU! Tente novamente!\033[m')
elif comp == 'Tesoura' and resp == 'Papel':
print('\033[31mVocê PERDEU! Tente novamente!\033[m')
elif comp == 'Papel' and resp == 'Pedra':
print('\033[31mVocê PERDEU! Tente novamente!\033[m')
elif resp == 'Pedra' and comp == 'Tesoura':
print('\033[36mVocê GANHOU! Meus parabéns!\033[m')
elif resp == 'Tesoura' and comp == 'Papel':
print('\033[36mVocê GANHOU! Meus parabéns!\033[m')
elif resp == 'Papel' and comp == 'Pedra':
print('\033[36mVocê GANHOU! Meus parabéns!\033[m')
else:
print('\033[31mERRO! Reinicie o programa e tente novamente!\033[m')