$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · medium · #146

What is the correct fix?

try:
    run()
except:
    pass
  1. Catch the specific exception
  2. Move run() out of the try
  3. Replace pass with return
  4. Add an else clause after
A bare except swallows everything, including KeyboardInterrupt and real bugs.
Play Problem Solving ▸