QuestionQ3

VerifiedExceptions

What is the expected result of running the following code?

Question Image

Explanation

The dictionary literal is syntactically invalid because '2' and '3' are not written as key: value entries. Python raises a SyntaxError while parsing the code, before the try/except statement can handle anything.

Community Discussion

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