Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numero_secreto = 42
- total_de_tentativas = 3
- while(total_de_tentativas > 0):
- chute = int(input('Digite o seu numero: '))
- print('Voce digitou: ', chute)
- acertou = chute == numero_secreto
- maior = chute > numero_secreto
- menor = chute < numero_secreto
- if(acertou):
- print('Voce acertou')
- elif(maior):
- print('Voce errou! O seu chute foi maior que o numero secreto')
- elif(menor):
- print('Voce errou! O seu chute foi menor que o numero secreto')
- total_de_tentativas = total_de_tentativas - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement