← Quiz: Exceptions and Files: all 15 questions
Quiz: Exceptions and Files · Question 13 of 15
Why is a bare except: (with no exception type) a bad idea?
Why is a bare except: (with no exception type) a bad idea?
- A.It is a SyntaxError
- B.It only catches ValueError
- C.It hides every error, including bugs you did not expect
- D.It makes the program slower
Answer & explanation
Correct answer: It hides every error, including bugs you did not expect
Catch only the errors you expect, such as ValueError for bad input.
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 →