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

Quiz: Exceptions and Files · Question 2 of 15

What error does int("12a") raise?

What error does int("12a") raise?

  1. A.TypeError
  2. B.ValueError
  3. C.SyntaxError
  4. D.KeyError
Answer & explanation

Correct answer: ValueError

The type (string) is acceptable, but the value can't be converted: ValueError.

Can you get the rest right without peeking?

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

Start the quiz →