Bird
0
0

Which exception class is the parent of ZeroDivisionError in Python?

easy📝 Conceptual Q2 of 15
Python - Custom Exceptions
Which exception class is the parent of ZeroDivisionError in Python?
ABaseException
BValueError
CException
DArithmeticError
Step-by-Step Solution
Solution:
  1. Step 1: Locate ZeroDivisionError in hierarchy

    ZeroDivisionError is a subclass of ArithmeticError, which itself is a subclass of Exception.
  2. Step 2: Identify immediate parent

    The immediate parent (direct superclass) of ZeroDivisionError is ArithmeticError.
  3. Final Answer:

    ArithmeticError -> Option D
  4. Quick Check:

    Parent of ZeroDivisionError = ArithmeticError [OK]
Quick Trick: ZeroDivisionError inherits from ArithmeticError [OK]
Common Mistakes:
  • Choosing Exception instead of ArithmeticError
  • Confusing ValueError as parent

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes