← Quiz: Debugging with AI: all 10 questions
Quiz: Debugging with AI · Question 7 of 10
What does this print? (code)
What does this print?
try:
int("AB")
except ValueError as e:
print(type(e).__name__)
- A.TypeError
- B.KeyError
- C.ValueError
- D.Error: invalid literal
Answer & explanation
Correct answer: ValueError
int() raises ValueError for text that is not a whole number.
Can you get the rest right without peeking?
Take the timed Quiz: Debugging with AI quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →