Advertisement
Le-Ownect

Jogo acerte a senha [ Python ] Concluido

Jul 1st, 2020
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. numero_secreto = 42
  2. total_de_tentativas = 3
  3.  
  4. while(total_de_tentativas > 0):
  5.     chute = int(input('Digite o seu numero: '))
  6.     print('Voce digitou: ', chute)
  7.  
  8.     acertou = chute == numero_secreto
  9.     maior = chute > numero_secreto
  10.     menor = chute < numero_secreto
  11.  
  12.     if(acertou):
  13.         print('Voce acertou')
  14.     elif(maior):
  15.         print('Voce errou! O seu chute foi maior que o numero secreto')
  16.     elif(menor):
  17.         print('Voce errou! O seu chute foi menor que o numero secreto')
  18.  
  19.     total_de_tentativas = total_de_tentativas - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement