🎙 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 1 of 10

Which exception does except LookupError: catch?

Which exception does except LookupError: catch?

  1. A.Only LookupError raised by your own code
  2. B.ValueError and TypeError
  3. C.Both KeyError and IndexError
  4. D.Every exception
Answer & explanation

Correct answer: Both KeyError and IndexError

KeyError and IndexError are subclasses of LookupError.

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 →