KnowledgeBoat Logo

Computer Science

Assertion (A): No matter what exception occurs, you can always make sure that some common action takes place for all types of exceptions.

Reasoning (R): The finally block contains the code that must execute.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Python Exception Handling

1 Like

Answer

Both A and R are true and R is the correct explanation of A.

Explanation
The 'finally' block contains code that must execute, irrespective of whether an exception is raised. This ensures that some common action takes place for all types of exceptions, no matter which exception occurs.

Answered By

1 Like


Related Questions