Python: Which statement about Exceptions and Custom Errors is the strongest interview answer?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

Which statement about Exceptions and Custom Errors is the strongest interview answer?

  1. Exceptions signal that code cannot honestly continue with the current state, and custom errors can give the domain a clearer failure vocabulary.
  2. Exceptions and Custom Errors is mostly a naming style choice and has little effect on runtime behavior or design tradeoffs.
  3. Exceptions and Custom Errors exists mainly to reduce the number of files in a Python project.
  4. Exceptions and Custom Errors matters only for frontend scripting and not for backend or automation code.

Hint

Start with the core rule behind Exceptions and Custom Errors.

Answer and rationale

Correct answer: A. Exceptions signal that code cannot honestly continue with the current state, and custom errors can give the domain a clearer failure vocabulary.

Exceptions signal that code cannot honestly continue with the current state, and custom errors can give the domain a clearer failure vocabulary. This is the base concept interviewers commonly test first.

Track: Python