🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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__)
  1. A.TypeError
  2. B.KeyError
  3. C.ValueError
  4. 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 →