QuestionQ75

VerifiedExceptions

What is the expected behavior of this code?

Question Image

Explanation

The assertion fails because the global variable m is initially 0. This raises AssertionError, which is not an ArithmeticError; the outer catch-all except handles it, increments m to 1, and the program prints 1.

Community Discussion

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