QuestionQ31

VerifiedFunctions and Exceptions

What is the anticipated output of the following code?

Question Image

Explanation

A raised Exception is caught by the first applicable handler. Since Exception inherits from BaseException, except BaseException: executes and prints 1; no subsequent except clause runs.

Community Discussion

No comments yet. Be the first to start the discussion!