CertGrid
Python Certification

PCEP: Certified Entry-Level Python Programmer Practice Exam

Validates entry-level Python 3 programming - data types and operators, control flow, data collections (lists, tuples, dictionaries, strings), and functions and exception handling.

Practice 801 exam-style PCEP questions with full answer explanations, then take timed mock exams that score like the real thing.

801
Practice pool
30 qs
Real exam
40 min
Real exam time
Foundational
Level
70%
Passing score

CertGrid runs a fixed 30-question timed mock, separate from the real exam format above.

Objective-mapped practice, aligned to current exam objectives · Reviewed Jul 2026 · Independent practice platform.

What the PCEP exam covers

Free PCEP sample questions

A sample of 10 questions with answers and explanations. Sign up free to practice all 801.

  1. Question 1Computer Programming and Python Fundamentals

    Which statement best describes how the standard CPython implementation runs a program?

    • AIt compiles the source into bytecode, which a virtual machine then executes.Correct
    • BIt translates the source directly into a standalone machine-code .exe first.
    • CIt runs each line as raw machine code with no translation step at all.
    • DIt needs the programmer to hand-compile the source into bytecode first.
    ✓ Correct answer: A

    CPython first compiles your source code into an intermediate form called bytecode, which the Python Virtual Machine then interprets and executes. This mix of compilation and interpretation is why Python is called an interpreted language.

    Why the other options are wrong
    • BCPython does not produce a standalone machine-code executable before running.
    • CSource is never executed as raw machine code line by line; it is compiled to bytecode first.
    • DThe bytecode step is automatic; the programmer does not compile it manually.
  2. Question 2Computer Programming and Python Fundamentals

    What is printed by the following snippet? print(2 ** 10)

    • A100
    • B20
    • C512
    • D1024Correct
    ✓ Correct answer: D

    The ** operator raises the left number to the power of the right number, so 2 ** 10 means 2 multiplied by itself ten times. That product is 1024, a familiar power of two.

    Why the other options are wrong
    • A100 is 10 ** 2 (ten squared); here the base and exponent are the other way around.
    • B20 is 2 * 10, which treats ** as multiplication rather than exponentiation.
    • C512 is 2 ** 9, one power short of 2 ** 10.
  3. Question 3Control Flow - Conditional Blocks and Loops

    What is the output of the following code? n = 4 if n % 2 == 0: print("even") elif n > 2: print("big") else: print("other")

    • AevenCorrect
    • Bbig
    • Cother
    • Deven big
    ✓ Correct answer: A

    n % 2 == 0 is True (4 is even), so the if block prints even. Even though n > 2 is also True, the elif is skipped because an earlier branch already matched.

    Why the other options are wrong
    • Bbig never runs here: the elif is only tested when the if condition is False.
    • Cother is the else branch, reached only when every earlier test fails.
    • DAt most one branch in an if / elif / else chain executes.
  4. Question 4Control Flow - Conditional Blocks and Loops

    When is the condition of a while loop tested?

    • AAfter each iteration, so the body always runs at least once
    • BOnly one time, just before the loop begins
    • COnly after the first iteration has finished
    • DBefore every iteration, including the first, so the body may run zero timesCorrect
    ✓ Correct answer: D

    A while loop tests its condition before every iteration, including the very first one, so if the condition is false at the start the body never runs. This is why a while loop can execute zero times. A loop that always runs at least once would be a post-test loop, which Python's while is not.

    Why the other options are wrong
    • AThat describes a post-test loop; Python's while tests before the body, so it may run zero times.
    • BThe condition is re-tested before each iteration, not only once at the start.
    • CThe condition is checked before the first iteration too, not just after it.
  5. Question 5Control Flow - Conditional Blocks and Loops

    What is printed by the following snippet? print(bool([]))

    • AFalseCorrect
    • BTrue
    • CNone
    • D0
    ✓ Correct answer: A

    bool() reports the truth value of whatever it is given. In Python any empty container counts as falsy, and [] is an empty list, so bool([]) returns False. A list is only truthy once it holds at least one item.

    Why the other options are wrong
    • BA list is truthy only when it has at least one element; this list is empty, so bool([]) is False.
    • Cbool() always returns a boolean (True or False), never None.
    • DThe result is the boolean False, printed as the word False, not the integer 0.
  6. Question 6Data Collections - Tuples, Dictionaries, Lists, and Strings

    What is printed by the following snippet? lst = [1, 2, 3] lst[0] = 10 print(lst)

    • A[10, 2, 3]Correct
    • B[1, 2, 10]
    • C[10, 1, 2, 3]
    • D[1, 10, 2, 3]
    ✓ Correct answer: A

    Lists are mutable, so assigning to lst[0] replaces the value stored at that position. Index 0 is the first element, so 1 is overwritten by 10, giving [10, 2, 3].

    Why the other options are wrong
    • B[1, 2, 10] would change the last element, but index 0 refers to the first position.
    • C[10, 1, 2, 3] inserts a new value, but assignment replaces the existing element rather than adding one.
    • D[1, 10, 2, 3] would change index 1; here index 0, the first element, is the one being set.
  7. Question 7Data Collections - Tuples, Dictionaries, Lists, and Strings

    What is printed by the following snippet? print((1, 2) == (1, 2))

    • ATrueCorrect
    • BFalse
    • C(1, 2)
    • DA TypeError is raised
    ✓ Correct answer: A

    Two tuples compare equal with == when they have the same length and equal elements in the same order. Both tuples are (1, 2), so the result is True.

    Why the other options are wrong
    • BThe tuples have identical contents, so they are equal, not unequal.
    • CThe == operator returns a Boolean, not one of the tuples.
    • DComparing tuples with == is valid and raises no error.
  8. Question 8Functions and Exceptions

    What is printed by the following snippet? def volume(length, width, height=1): return length * width * height print(volume(2, 3))

    • A6Correct
    • B5
    • C0
    • DNone
    ✓ Correct answer: A

    Only two arguments are passed, so height uses its default of 1. The result is 2 * 3 * 1, which is 6.

    Why the other options are wrong
    • B5 would be 2 + 3, but the body multiplies the three values.
    • C0 would require height to be 0, but its default is 1.
    • DThe function returns a number via return, so it is not None.
  9. Question 9Functions and ExceptionsSelect all that apply

    Which TWO statements about the global keyword are correct? Select TWO.

    • AIt lets a function assign a new value to a global variable.Correct
    • BIt must be used to read a global variable's value.
    • CWithout it, an assignment to a name inside a function creates a local variable.Correct
    • DIt creates a brand-new local variable each time the function runs.
    ✓ Correct answer: A, C

    global tells Python that assignments to the name inside the function should target the module-level variable. Without global, any assignment to a name in a function makes that name local. Reading a global never requires global.

    Why the other options are wrong
    • BReading a global variable inside a function needs no keyword; global is only required to assign to it.
    • Dglobal does the opposite of creating a local: it binds the name to the global, not a fresh local.
  10. Question 10Functions and Exceptions

    In what order are the lines printed by the following snippet? try: print('try') except ValueError: print('except') else: print('else') finally: print('finally')

    • Atry, except, finally
    • Btry, finally
    • Ctry, else, except, finally
    • Dtry, else, finallyCorrect
    ✓ Correct answer: D

    The try block succeeds, so the except branch is skipped, the else branch runs, and the finally branch always runs last.

    Why the other options are wrong
    • AThe except branch runs only when a matching exception is raised.
    • BThe else branch runs after a successful try, so else prints too.
    • CThe except branch is skipped when no exception is raised.

Related Python resources

PCEP practice exam FAQ

How many questions are in the PCEP practice exam on CertGrid?

CertGrid has 801 practice questions for PCEP: Certified Entry-Level Python Programmer, covering 4 exam domains. The real PCEP exam is 30 qs in 40 min. CertGrid's timed mock is a fixed 30 questions.

What is the passing score for PCEP?

The PCEP exam passing score is 70%, and you have about 40 min to complete it. CertGrid scores your practice attempts the same way so you know when you are ready.

Are these official PCEP exam questions?

No. CertGrid is an independent practice platform. We do not provide real or leaked exam questions. Our questions are original and designed to help you practice the concepts, scenarios, and difficulty style of the PCEP: Certified Entry-Level Python Programmer exam.

Can I practice PCEP for free?

Yes. You can start practicing PCEP: Certified Entry-Level Python Programmer for free with daily practice and sample questions. Paid plans unlock full timed exams, complete explanations, and domain analytics.

What CertGrid is (and is not)

CertGrid is an independent IT certification practice platform for Azure, AWS, Google, Cisco, Security, Linux, Kubernetes, Terraform, and other certification tracks. It provides objective-mapped practice questions, readiness scoring, weak-domain drills, and explanations to help learners understand what to study next.

Independent & original. CertGrid is an independent practice platform and is not affiliated with or endorsed by Python. Questions are original practice items designed to mirror certification concepts and exam style. CertGrid does not provide official exam questions or braindumps.