import random
print('=-=' * 10)
print(' JOGO DA ADIVINHAÇÂO ')
print('=-=' * 10)
numero_secreto = random.randrange(1, 101)
total_de_tentativas = 3
rodada = 1
while rodada <= total_de_tentativas:
print(f'Tentativa {rodada} de {total_de_tentativas}.')
chute = int(input('Chute um número de 1 e 100: '))
print(f'Você chutou: {chute}')
if chute < 1 or chute > 100:
print('Você deve digitar um número entre 1 e 100!')
continue
acertou = chute == numero_secreto
maior = chute > numero_secreto
menor = chute < numero_secreto
if acertou:
print('Acertou!')
break
else:
if maior:
print('ERROU! Menos que isso')
elif menor:
print('ERROU! Mais que isso')
if total_de_tentativas == rodada:
print('Acabou as tentativas :(')
rodada += 1
print('Fim do jogo')