Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Why is a bare 'except:' clause considered bad practice?

  1. A It is slower
  2. B It catches KeyboardInterrupt and SystemExit, and hides genuine programming errors
  3. C It is invalid syntax in Python 3
  4. D It only catches the first exception
Answer

It catches KeyboardInterrupt and SystemExit, and hides genuine programming errors

Use 'except Exception:' if a broad catch is genuinely needed, and catch the narrowest applicable exception wherever possible.

All Python MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as