Skip to main contentSkip to solution

Out of the following statements, which one is incorrect in the context of exceptions in Python?

Solution

✅ Correct Option: 2

Option 2 is incorrect because the else block does not catch anything. In Python, an exception raised in the try block is caught and handled by the matching except block. The else block runs only when the try block finishes with no exception.


Option 3: this one is a trap. Exceptions are raised inside try, and the try/except pair catches them. This is the usual textbook wording, so it is treated as correct.

Option 4: finally always runs, whether or not an exception occurred.

Memory trick: else means "else, if no exception occurred".

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question