← 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?
- A.Only LookupError raised by your own code
- B.ValueError and TypeError
- C.Both KeyError and IndexError
- 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 →