PythonJuly 7, 202611 min read

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.

30Questions
40 minDuration
70%To pass
4Sections
$69USD fee

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.

How to use this: run each snippet in your head first, then reveal. If you got the letter right but could not explain why the distractors fail, treat it as wrong and revisit that topic — searching for “PCEP dumps” only teaches you leaked answers, not the behaviour the exam actually tests.

10 PCEP practice questions

Q1EasyFundamentals

What does this program print?

x = 17
y = 5
print(x // y, x % y)
  1. 3.4 2
  2. 3 2
  3. 3 3
  4. 4 2
Show answer & explanation
Correct: B

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.

Q2MediumFundamentals

What is printed?

print(2 ** 3 ** 2)
  1. 64
  2. 512
  3. 128
  4. 512.0
Show answer & explanation
Correct: B

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.

Q3EasyControl flow

What does this print?

x = 0
if x:
    print("A")
elif x == 0:
    print("B")
else:
    print("C")
  1. A
  2. B
  3. C
  4. A B
Show answer & explanation
Correct: B

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.

Q4MediumControl flow

What is the output?

for n in range(1, 6):
    if n % 2 == 0:
        continue
    print(n, end="")
  1. 135
  2. 12345
  3. 246
  4. 15
Show answer & explanation
Correct: A

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.

Q5HardControl flow

What does this loop print?

i = 1
while i < 10:
    if i == 4:
        break
    print(i, end=" ")
    i += 1
  1. 1 2 3
  2. 1 2 3 4
  3. 1 2 3 4 5 6 7 8 9
  4. 4
Show answer & explanation
Correct: A

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.

Q6MediumData collections

What is printed?

nums = [10, 20, 30, 40, 50]
print(nums[::-2])
  1. [10, 30, 50]
  2. [50, 30, 10]
  3. [50, 40, 30, 20, 10]
  4. [10, 20, 30, 40, 50]
Show answer & explanation
Correct: B

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.

Q7MediumData collections

What happens when this runs?

d = {}
d[(1, 2)] = "a"
d[[3, 4]] = "b"
print(len(d))
  1. It prints 2
  2. It prints 1
  3. TypeError: unhashable type: 'list'
  4. TypeError: unhashable type: 'tuple'
Show answer & explanation
Correct: C

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.

Q8MediumData collections

What is the output?

s = "Python"
print(s[1:4].upper())
print(s)
  1. YTH then Python
  2. PYT then Python
  3. YTHO then PYTHON
  4. YTH then YTH
Show answer & explanation
Correct: A

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".

Q9HardFunctions

What does this print?

def add(x, lst=[]):
    lst.append(x)
    return lst

print(add(1))
print(add(2))
  1. [1] then [2]
  2. [1] then [1, 2]
  3. [1, 2] then [1, 2]
  4. [1] then [2, 1]
Show answer & explanation
Correct: B

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.

Q10MediumExceptions

What is printed?

try:
    x = int("10")
    y = x / 0
except ValueError:
    print("value")
except ZeroDivisionError:
    print("zero")
else:
    print("ok")
finally:
    print("done")
  1. value then done
  2. zero then done
  3. ok then done
  4. zero then ok then done
Show answer & explanation
Correct: B

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:

Control flow – conditional blocks & loops29%
Functions & exceptions28%
Data collections – tuples, dictionaries, lists & strings25%
Computer programming & Python fundamentals18%

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.

0–5Not ready yet. You are guessing on core Python behaviour. Rebuild the fundamentals — operator precedence, loop control, slicing, and scope — before booking.
6–8Close. You know the syntax but slip on edge cases (right-associative **, mutable default arguments, try/except/else/finally). Drill a full timed bank and target weak sections.
9–10Exam-ready signal. Confirm with a couple of full-length timed mocks under exam conditions, then book PCEP-30-02 with confidence.

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