← Quiz: Reviewing AI Code: all 10 questions
Quiz: Reviewing AI Code · Question 4 of 10
Why is except Exception: return 0 dangerous?
Why is except Exception: return 0 dangerous?
- A.It is slow
- B.It hides real bugs (like passing None) as normal results
- C.Python doesn't allow it
- D.It returns a string
Answer & explanation
Correct answer: It hides real bugs (like passing None) as normal results
Catch the specific exception you expect (KeyError) and let unexpected errors surface.
Can you get the rest right without peeking?
Take the timed Quiz: Reviewing AI Code quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →