Question 501 of 498
PCEP Practice Question: Functions, Tuples, Dictionaries and Exceptions
Which TWO of the following exceptions are built-in Python exceptions? (Select exactly 2)
⚠ Common exam trap
Python Institute often tests the distinction between built-in exceptions and non-existent exceptions like StringError, NumberError, or ListError, which are not part of Python's standard library, to catch candidates who guess based on naming patterns rather than actual Python knowledge.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
ZeroDivisionError
ZeroDivisionError is a built-in Python exception that is raised when the second operand of a division or modulo operation is zero. It is part of Python's standard exception hierarchy and is commonly encountered in arithmetic operations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
ZeroDivisionError
Why this is correct
Built-in exception for division by zero.
- ✓
KeyError
Why this is correct
Built-in exception for missing dictionary keys.
- ✗
StringError
Why it's wrong here
Not a standard Python exception.
- ✗
NumberError
Why it's wrong here
Not a standard Python exception.
- ✗
ListError
Why it's wrong here
Not a standard Python exception.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on PCEP
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Refer to the exhibit. What type of exception occurred?
easy- ✓ A.ZeroDivisionError
- B.TypeError
- C.ValueError
- D.ArithmeticError
Why A: The code attempts to divide by zero (e.g., `10 / 0`), which raises a `ZeroDivisionError` in Python. This is a specific built-in exception for division or modulo operations where the divisor is zero.
Variation 2. Refer to the exhibit. What exception is raised when this code is executed?
easy- A.ValueError
- ✓ B.ZeroDivisionError
- C.ArithmeticError
- D.TypeError
Why B: The code attempts to divide by zero, which raises a ZeroDivisionError in Python. This is a specific exception for division or modulo operations where the divisor is zero, and it is a subclass of ArithmeticError.
Last reviewed: Jun 30, 2026
This PCEP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCEP exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.