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