PCEP Practice Questions (2026): 10 Free Entry-Level Python Questions with Answers
Ten exam-style questions across all four PCEP-30-02 sections — each with the correct answer and a plain-English explanation on click. Score yourself at the end to see if you are exam-ready.
The PCEP – Certified Entry-Level Python Programmer (PCEP-30-02) exam is the first rung on the OpenEDG Python Institute ladder. It rewards people who can actually read and reason about small Python programs — tracing loops, slicing lists, predicting what a snippet prints — not people who only skimmed the syntax.
Below are 10 free PCEP practice questions written in the same style as the real exam, weighted toward the heaviest sections (control flow, data collections, and functions & exceptions). Read each snippet, predict the output or pick the fix, then hit Show answer & explanation. Keep score — there is a readiness check at the bottom.
10 PCEP practice questions
What does this program print?
x = 17
y = 5
print(x // y, x % y)- 3.4 2
- 3 2
- 3 3
- 4 2
Show answer & explanation
The // operator is floor (integer) division: 17 // 5 is 3. The % operator returns the remainder: 17 % 5 is 2. So the output is 3 2. Option A is what true division / would give (3.4), which is a different operator. Because both operands are ints, both results are ints.
What is printed?
print(2 ** 3 ** 2)- 64
- 512
- 128
- 512.0
Show answer & explanation
The exponentiation operator ** is right-associative, so the expression evaluates as 2 ** (3 ** 2) = 2 ** 9 = 512, not (2 ** 3) ** 2 = 64. Because both operands are integers, the result is the int 512, not the float 512.0.
What does this print?
x = 0
if x:
print("A")
elif x == 0:
print("B")
else:
print("C")- A
- B
- C
- A B
Show answer & explanation
if x: tests the truthiness of x. The integer 0 is falsy, so the first branch is skipped. The elif then checks x == 0, which is True, so B is printed. Only the first matching branch in an if/elif/else chain runs, so else is never reached.
What is the output?
for n in range(1, 6):
if n % 2 == 0:
continue
print(n, end="")- 135
- 12345
- 246
- 15
Show answer & explanation
range(1, 6) yields 1, 2, 3, 4, 5 — the stop value 6 is excluded. continue skips the rest of the loop body for even numbers, so 2 and 4 are never printed. end="" removes the newline, so the odd values print with no separator: 135.
What does this loop print?
i = 1
while i < 10:
if i == 4:
break
print(i, end=" ")
i += 1- 1 2 3
- 1 2 3 4
- 1 2 3 4 5 6 7 8 9
- 4
Show answer & explanation
break exits the whole loop immediately — before the print — the first time i equals 4. So 1, 2, and 3 are printed and 4 is not. If continue were used instead, it would skip the i += 1 increment and the loop would run forever. Without the break, i < 10 would let it count up to 9.
What is printed?
nums = [10, 20, 30, 40, 50]
print(nums[::-2])- [10, 30, 50]
- [50, 30, 10]
- [50, 40, 30, 20, 10]
- [10, 20, 30, 40, 50]
Show answer & explanation
The slice [start:stop:step] with a step of -2 walks the list backwards two elements at a time, starting from the last item: 50, then 30, then 10 → [50, 30, 10]. A positive step of 2 (nums[::2]) would instead give [10, 30, 50]; a plain [::-1] would reverse the whole list.
What happens when this runs?
d = {}
d[(1, 2)] = "a"
d[[3, 4]] = "b"
print(len(d))- It prints 2
- It prints 1
- TypeError: unhashable type: 'list'
- TypeError: unhashable type: 'tuple'
Show answer & explanation
Dictionary keys must be hashable. A tuple is immutable and hashable, so (1, 2) is a valid key. A list is mutable and unhashable, so using [3, 4] as a key raises TypeError: unhashable type: 'list' — the program stops before print is ever reached. This is a classic way the exam probes the tuple-versus-list distinction.
What is the output?
s = "Python"
print(s[1:4].upper())
print(s)- YTH then Python
- PYT then Python
- YTHO then PYTHON
- YTH then YTH
Show answer & explanation
s[1:4] takes the characters at indexes 1, 2, 3 — "yth" (index 4 is excluded). .upper() returns a new string "YTH". Strings are immutable, so upper() never changes s itself; the second print still shows the original "Python".
What does this print?
def add(x, lst=[]):
lst.append(x)
return lst
print(add(1))
print(add(2))- [1] then [2]
- [1] then [1, 2]
- [1, 2] then [1, 2]
- [1] then [2, 1]
Show answer & explanation
A default argument value is evaluated once, when the function is defined — not on every call. So both calls share the same list object. The first call appends 1 and returns [1]; the second appends 2 to that same list and returns [1, 2]. The standard fix is to default to None and create a fresh list inside the function body.
What is printed?
try:
x = int("10")
y = x / 0
except ValueError:
print("value")
except ZeroDivisionError:
print("zero")
else:
print("ok")
finally:
print("done")- value then done
- zero then done
- ok then done
- zero then ok then done
Show answer & explanation
int("10") succeeds, so no ValueError is raised. Then x / 0 raises ZeroDivisionError, caught by the matching except → prints zero. The else block runs only when the try body raises no exception, so it is skipped here. finally always runs → prints done. Final output: zero then done.
What these questions cover
The 10 questions are weighted to mirror the official PCEP-30-02 blueprint, so your score here is a rough proxy for the live exam. These are the four sections and their exact exam weights:
Score yourself
Count how many of the 10 you got right before revealing the answer. Then read the band you land in honestly — the goal is a real pass, not a good feeling.
**, mutable default arguments, try/except/else/finally). Drill a full timed bank and target weak sections.Want the full PCEP question bank?
These 10 are a taster. The ExamCert PCEP practice test runs hundreds of exam-style questions with explanations, timed mocks, and weak-section tracking — the same OpenEDG-style item formats you will meet on test day.
PCEP exam FAQ
How many questions are on the PCEP-30-02 exam?
30 questions in a 40-minute window, plus about 5 minutes for the NDA and tutorial. Item formats include single- and multiple-select, drag-and-drop, gap fill, sort, code fill, code insertion, and interactive scenario-based questions. It is delivered online through the OpenEDG Testing Service (TestNow).
What score do I need to pass the PCEP exam?
A cumulative score of at least 70%. Your raw score is normalised and reported as a percentage, so aim comfortably above 70% in practice to leave a safety margin on exam day.
How much does the PCEP-30-02 exam cost?
A single voucher starts at USD $69 through OpenEDG. Bundles that add a retake and an official practice test cost more — up to about $95. Prices can vary by region and promotion.
Is PCEP-30-02 the current version in 2026?
Yes. PCEP-30-02 is the current version of the PCEP – Certified Entry-Level Python Programmer certification, having replaced PCEP-30-01. It has no prerequisites and covers four sections: Python fundamentals, control flow, data collections, and functions and exceptions.
ExamCert Team — we build exam-style practice banks and prep apps for 90+ IT certifications. Questions here are original, written to match the PCEP-30-02 objectives; they are not real exam items.
Related: PCEP exam guide · PCEP dumps vs practice tests · Free practice tests
