Question:medium

Which of the following statements are correct with respect to handling exceptions in Python?
A. The try block is used to catch exceptions.
B. The except block is executed if an exception occurs.
C. You can have multiple except blocks.
D. The else block executes if no exceptions occur.
Choose the correct answer from the options given below:

Show Hint

Remember the full exception handling block structure:
- try: monitored code.
- except: handles exceptions.
- else: runs if NO exception occurs.
- finally: always runs (for cleanup tasks).
Updated On: Jun 11, 2026
  • A, B and D only
  • A, C and D only
  • A, B, C and D
  • B, C and D only
Show Solution

The Correct Option is C

Solution and Explanation


Step 1: Understanding the Question:

The question presents four statements (A, B, C, D) about Python's built-in exception-handling blocks and asks to identify which statements are correct.

Step 2: Python Exception Handling Framework:

- try block: Monitors and intercepts any run-time errors (exceptions) raised during its execution.
- except block: Catches and handles specific exceptions thrown by the matching try block.
- else block: Executes only if no exceptions were raised during the execution of the try block.

Step 3: Detailed Evaluation of Statements:

- Statement A is correct: The try block is where we enclose code that may cause errors, acting as the interceptor to catch any exceptions.
- Statement B is correct: If an exception is raised in the try block, execution of the try block stops immediately and transfers to the except block to handle the error.
- Statement C is correct: Python allows us to write multiple except blocks to handle different error types separately (e.g., except ValueError followed by except ZeroDivisionError).
- Statement D is correct: The optional else block is defined to execute only if the code in the try block runs successfully without raising any exceptions.
- Since all four statements are correct, Option (C) is the right choice.

Step 4: Final Answer:

All the statements A, B, C, and D are correct descriptions of Python exception handling.
Hence, option (C) is the correct choice.
Was this answer helpful?
0


Questions Asked in CUET (UG) exam