Skip to main contentSkip to solution

_____________block will only be executed if some exception is raised in the _____________block.

Solution

✅ Correct Option: 3

The except block runs only when an exception is raised inside the try block. The try block holds the code that might fail, and if it raises an exception, control jumps to the matching except block. If no exception occurs, except is skipped.


Option 1: finally runs always, whether or not an exception occurs, and try is not a block that runs "because of" an exception.

Option 2: else runs only when no exception is raised, which is the opposite of what the question describes.

Option 4: finally is not where an exception is raised, and it runs regardless of the outcome.

Keyboard Shortcuts

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