🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Exceptions in Depth: all 10 questions

Quiz: Exceptions in Depth · Question 4 of 10

What does this print? (code)

What does this print?

try:
    int("x")
except Exception:
    print("general")
except ValueError:
    print("value")
  1. A.general
  2. B.value
  3. C.general value
  4. D.An error
Answer & explanation

Correct answer: general

The first matching clause wins, and Exception matches ValueError.

Can you get the rest right without peeking?

Take the timed Quiz: Exceptions in Depth quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →