-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex058.py
33 lines (24 loc) · 799 Bytes
/
ex058.py
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
'''
Melhore o jogo DESAFIO 028 onde o camputador vai "Pensar" em um número entre 0 e 10.
Só que agora o jogador vai tentar adivinhar até acertar, mostrando no final quantos palpites foram necessários para vencer.
'''
import random
from random import randint
from time import sleep
computador = random.randint(0, 5)
print('-=-' * 20)
print('\t\tPENSAREI UM NÚMERO, TENTE ADIVINHAR')
print('-=-' * 20)
n = 0
tentativas = 0
while n != computador:
n = int(input('Em qual número eu pensei? '))
print('HMMM...')
sleep(0.8)
tentativas += 1
if n != computador:
print('\033[1;31mBEEEEEEHHH, Tente Novamente haha!\033[m')
if tentativas == 1:
print(f'Caraca de Primeira O_O')
else:
print(f'Finalmente você acertou em kkk, depois de {tentativas} tentativas')