LogiQuest
Back to Exceptions
17

What is the output of the following code?

try:
    try:
        {}['k']
    except KeyError:
        raise ValueError('wrapped')
except ValueError as e:
    print(e, type(e.__context__).__name__)
Hard

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.