the next summary in this we explored coding user-defined exceptions as we learnedexceptions are implemented as class instance objects as of python and (an earlier stringbased exception model alternative was available in earlier releases but has now been deprecatedexception classes support the concept of exception hierarchies that ease maintenanceallow data and behavior to be attached to exceptions as instance attributes and methodsand allow exceptions to inherit data and behavior from superclasses we saw that in try statementcatching superclass catches that class as well as all subclasses below it in the class tree--superclasses become exception category namesand subclasses become more specific exception types within those categories we also saw that the built-in exception superclasses we must inherit from provide usable defaults for printing and state retentionwhich we can override if desired the next wraps up this part of the book by exploring some common use cases for exceptions and surveying tools commonly used by python programmers before we get therethoughhere' this quiz test your knowledgequiz what are the two new constraints on user-defined exceptions in python how are raised class-based exceptions matched to handlers name two ways that you can attach context information to exception objects name two ways that you can specify the error message text for exception objects why should you not use string-based exceptions anymore todaytest your knowledgeanswers in xexceptions must be defined by classes (that isa class instance object is raised and caughtin additionexception classes must be derived from the builtin class baseexceptionmost programs inherit from its exception subclassto support catchall handlers for normal kinds of exceptions class-based exceptions match by superclass relationshipsnaming superclass in an exception handler will catch instances of that classas well as instances of any of its subclasses lower in the class tree because of thisyou can think of superclasses as general exception categories and subclasses as more specific types of exceptions within those categories test your knowledgeanswers