← Quiz: Exceptions in Depth: all 10 questions
Quiz: Exceptions in Depth · Question 5 of 10
What should a custom exception class usually inherit from?
What should a custom exception class usually inherit from?
- A.BaseException
- B.object
- C.Exception (or one of its subclasses)
- D.KeyboardInterrupt
Answer & explanation
Correct answer: Exception (or one of its subclasses)
BaseException is reserved for system-exiting exceptions like KeyboardInterrupt.
Can you get the rest right without peeking?
Take the timed Quiz: Exceptions in Depth quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →