The statements inside the _____ block are always executed regardless of whether an exception has occurred or not.
The statements inside the _____ block are always executed regardless of whether an exception has occurred or not.
Solution
The finally block runs every time, whether the try block raised an exception, ran cleanly, or was left through return, break or continue. It is used for clean-up work such as closing files or releasing connections.
Option 1: try holds the code that may raise an exception, and it stops at the point where the exception occurs.
Option 2: except runs only when a matching exception is raised.
Option 4: else runs only when the try block finishes with no exception, the opposite condition to except.
Related questions:
2026: 18 May Shift 2
2026: 11 May Shift 2
2026: 29 May Shift 1
2026: 29 May Shift 1