QuestionQ66

VerifiedExceptions

What is the expected result of running the following code?

Question Image

Explanation

Converting the string '2A' with int() raises a ValueError. The preceding bare except handler catches it and assigns n = 3, so the program prints 3.

Community Discussion

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