PCEP Practice Question: Functions, Tuples, Dictionaries and Exceptions
Which THREE of the following statements about Python exception handling are correct?
⚠ Common exam trap
The PCEP exam often tests the misconception that a `finally` block requires an accompanying `except` block, or that a `try` block must always have at least one `except` block, when in fact `try-finally` alone is valid Python syntax.
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
✓
The finally block always runs.
The `finally` block in Python is guaranteed to execute regardless of whether an exception occurred, was caught, or even if the `try` block contains a `return`, `break`, or `continue` statement. This ensures cleanup actions like closing files or releasing resources always run.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The finally block always runs.
Why this is correct
The finally clause executes regardless of whether an exception occurred or not.
- ✓
The else block runs if no exception occurred.
Why this is correct
The else clause executes when the try block does not raise an exception.
- ✗
You must have at least one except block if you have a finally block.
Why it's wrong here
A try-finally block is valid without any except block.
- ✓
You can have multiple except blocks for different exception types.
Why this is correct
Multiple except blocks allow handling different exception types separately.
- ✗
A try block must have at least one except block.
Why it's wrong here
A try block can have only a finally block, no except.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PCEP question from scratch — 498 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.