fork download
  1. from random import randint
  2.  
  3. pc = randint(0, 4)
  4. contador = 0
  5. while True:
  6. contador += 1
  7. tent = int(input('PALPITE:'))
  8. if tent == pc:
  9. break
  10. print('Você errou! Tente novamente '.format(pc))
  11. print('Parabens!Você acertou! o Número que o computador escolheu foi {} em {} tentativas.'.format(pc, contador))
  12.  
  13. #https://pt.stackoverflow.com/q/435391/101
Runtime error #stdin #stdout #stderr 0.12s 23344KB
stdin
1
2
3
4
stdout
PALPITE:Você errou! Tente novamente 
PALPITE:Você errou! Tente novamente 
PALPITE:Você errou! Tente novamente 
PALPITE:Você errou! Tente novamente 
PALPITE:
stderr
Traceback (most recent call last):
  File "./prog.py", line 7, in <module>
EOFError: EOF when reading a line