← 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")
- A.general
- B.value
- C.general value
- 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 →