StudyToCert

All certifications / PCEP / Lessons

PCEP – Certified Entry-Level Python Programmer PCEP-30-02 · Domain 4: Functions and exceptions

Common built-in exceptions: ZeroDivisionError, IndexError, KeyError, TypeError, ValueError, NameError

▶ Watch the overview video

Last reviewed September 30, 2026 · Leer en español

PCEP expects you to look at a short snippet and name the exception it raises. Six built-in exceptions come up again and again. Learn what triggers each one and how they differ, especially the pair TypeError and ValueError, which accounts for many wrong answers. When an exception is not handled, Python prints a traceback ending with a line like ZeroDivisionError: division by zero; the last line names the exception type and message, which is where to look first.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 7 more sections, 7 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study PCEP for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the PCEP study plan