fork download
  1. def pedeChute():
  2. while True:
  3. try:
  4. chute = int(input("chute: "))
  5. return chute
  6. except:
  7. pass
  8.  
  9. def jogo():
  10. while True:
  11. #algo aqui
  12. chute = pedeChute() #sempre será válido
  13. if chute == 0:
  14. break
  15. #algo aqui
  16.  
  17. #https://pt.stackoverflow.com/q/449742/101
Success #stdin #stdout 0.02s 9284KB
stdin
a
1
0
stdout
Standard output is empty