How do you define a custom exception in Python?
Correct answer
A. Subclass Exception
5 views
A. Subclass Exception
5 views
Custom exceptions inherit from Exception: class MyError(Exception): pass
Asked in: Python Interview Exception Handling
https://docs.python.org/3/tutorial/errors.htmlNot sure why the answer is A? Ask here and get an explanation.