🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › Web & Software Development › Certification Exam Preparation: ITF+, Linux+, and PCEP Python › Lesson 3
TEC-WEB46-10 · Lesson 3 · 20 clock hours · lab

PCEP Python Objective Review and Diagnostic

Objective. Students will review all PCEP exam syllabus sections—computer programming fundamentals, Python basics, data types, control flow, functions, and Python collections—and score at least 70% on a full PCEP-format practice exam.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

PCEP Python Objective Review and Diagnostic

Why This Lab Matters

The PCEP — Certified Entry-Level Python Programmer — credential from the Python Institute validates that you can write, read, and reason about basic Python programs. Employers in web and software development use it as a reliable signal that a candidate understands the language at a working level, not just in theory. This lab treats the full PCEP syllabus as a checklist: you will find out exactly where your knowledge is solid and where gaps remain, then close those gaps before exam day.

The PCEP Exam Format at a Glance

The PCEP exam uses multiple formats in a single sitting: multiple-choice questions with one or more correct answers, fill-in-the-blank items where you type or select the exact output a code snippet would produce, and code-ordering (drag-and-drop) items where you arrange lines into correct sequence. Time is limited, so you must be able to read short code blocks quickly and reason through them without running the interpreter. Understanding this format is why the activities in today's lab deliberately ask you to predict output before you run anything.

PCEP Syllabus Sections You Must Know

The Python Institute publishes an official PCEP exam syllabus at pythoninstitute.org. Download it and keep it open throughout this lab. The major sections are:

1. Computer Programming Fundamentals — what programs are, how interpreters work, the concept of compilation vs. interpretation, basic I/O.

2. Python Basics — literals, variables, operators (arithmetic, comparison, logical, bitwise), operator precedence, comments, `print()` and `input()`.

3. Data Types and Type Casting — integers, floats, strings, Booleans, `type()`, explicit conversion with `int()`, `float()`, `str()`, and `bool()`.

4. Control Flow — `if / elif / else`, `while`, `for`, `range()`, `break`, `continue`, `pass`.

5. Functions — defining with `def`, parameters vs. arguments, return values, default parameter values, keyword arguments, scope (local vs. global), the `None` value.

6. Python Collections — lists (indexing, slicing, mutability, list methods), tuples (immutability), dictionaries (key-value pairs, common methods), and basic string operations.

Every question on the practice exam and on the real PCEP maps back to one of these sections. Your gap-tracking spreadsheet will use the same section names so you can see at a glance which areas to prioritize.

Common Pitfalls That Cost Points

Operator precedence trips up most learners. Python follows standard mathematical precedence: exponentiation (`**`) is evaluated before unary minus, then multiplication and division, then addition and subtraction. Logical operators have even lower precedence: `not` before `and` before `or`. When in doubt, add parentheses — but on the exam you must read code that does not have them.

Scope is another frequent stumbling block. A variable assigned inside a function is local to that function unless you declare it `global`. Trying to read a local variable before it is assigned inside the same function raises an `UnboundLocalError`, not `NameError` — a distinction the exam tests.

List mutability vs. tuple immutability: lists can be changed in place; tuples cannot. When you assign a list to a second variable name and then modify the list, both names reflect the change because they point to the same object. This behavior does not apply to integers or strings, which are immutable.

String indexing: Python strings are zero-indexed. Negative indices count from the end: `s[-1]` is the last character. Slices use `s[start:stop]` where `stop` is exclusive.

`range()` behavior: `range(5)` produces `0, 1, 2, 3, 4` — five values, stopping before 5. `range(1, 6)` produces `1, 2, 3, 4, 5`. `range(0, 10, 2)` produces `0, 2, 4, 6, 8`. Exam items often require you to count the exact number of loop iterations.

Safety and Professional Conduct in the Lab

This is a software lab, so physical hazards are minimal. However, several professional practices apply:

How to Use the Diagnostic Results

After you score the diagnostic, calculate your percentage per syllabus section, not just overall. A 72% overall score that hides a 45% score in Functions means your study time should go to Functions first. Enter each missed question in the gap-tracking spreadsheet with the syllabus section, the concept tested, and a one-sentence note about why you missed it. This turns errors into a personalized study guide.

During the coding lab, work through the exercises for your three weakest sections. For every exercise: write your predicted output as a comment before running the code, run it, then compare. If there is a discrepancy, do not move on until you can explain it in plain language. Understanding why the output differs from your prediction is the fastest path to closing the gap.

Building Your Cheat Sheet

Your one-page cheat sheet should be selective, not exhaustive. Prioritize: operator precedence table, `range()` syntax, list slice syntax, function scope rules, and the five or six built-in functions most common on the PCEP (`len()`, `type()`, `int()`, `str()`, `float()`, `bool()`). When your partner reviews your cheat sheet, they should be able to spot anything missing, ambiguous, or incorrect. The timed 30-question practice set that follows is your final check before the real exam.

Key terms8

Operator precedenceThe rules Python uses to determine the order in which operators are evaluated in an expression; for example, `**` is evaluated before `*`, which is evaluated before `+`.
ScopeThe region of a program where a variable name is visible and accessible; variables assigned inside a function are local (not visible outside) unless declared `global`.
MutabilityThe property of an object that can be changed after it is created; lists are mutable, while tuples and strings are immutable.
Type castingExplicitly converting a value from one data type to another using built-in functions such as `int()`, `float()`, `str()`, or `bool()`.
range()A Python built-in that generates a sequence of integers; `range(start, stop, step)` includes `start` but excludes `stop`.
SliceA way to extract a portion of a sequence (list or string) using `sequence[start:stop]` syntax, where the element at index `stop` is not included.
Default parameter valueA value assigned to a function parameter in the `def` statement so that the caller may omit that argument; for example, `def greet(name='World')`.
PCEP syllabus sectionOne of the official topic areas published by the Python Institute that defines exactly what knowledge the PCEP exam tests; used to map missed questions to targeted study.

Worked examples4

1. Predict the output of this code block: ```python x = 2 + 3 * 4 ** 2 print(x) ```
  1. Step 1 — Identify operators: addition (+), multiplication (*), exponentiation (**).
  2. Step 2 — Apply precedence: exponentiation first. 4 ** 2 = 16.
  3. Step 3 — Multiplication next. 3 * 16 = 48.
  4. Step 4 — Addition last. 2 + 48 = 50.
  5. Step 5 — `print(x)` outputs the integer 50.
Answer: 50
2. How many times does the loop body execute, and what is printed on the last iteration? ```python for i in range(2, 11, 3): print(i) ```
  1. Step 1 — Identify `range(2, 11, 3)`: start = 2, stop = 11 (exclusive), step = 3.
  2. Step 2 — List the values produced: 2, 5, 8. The next value would be 11, which equals stop, so it is excluded.
  3. Step 3 — Count iterations: 3 iterations total.
  4. Step 4 — The last value printed is 8.
Answer: The loop executes 3 times; the last value printed is 8.
3. What is the output of the following code that tests scope rules? ```python x = 10 def change(): x = 99 change() print(x) ```
  1. Step 1 — `x = 10` assigns 10 to a global variable named `x`.
  2. Step 2 — Inside `change()`, `x = 99` creates a *local* variable named `x`; it does not affect the global `x` because there is no `global x` declaration.
  3. Step 3 — `change()` is called; the local `x` is set to 99 and then discarded when the function returns.
  4. Step 4 — `print(x)` reads the global `x`, which is still 10.
Answer: 10
4. What is the output? ```python a = [1, 2, 3] b = a b.append(4) print(a) ```
  1. Step 1 — `a = [1, 2, 3]` creates a list object and binds the name `a` to it.
  2. Step 2 — `b = a` does NOT copy the list; both `a` and `b` now refer to the same list object in memory.
  3. Step 3 — `b.append(4)` mutates the shared list object, adding 4.
  4. Step 4 — `print(a)` prints the same object, which now contains 4.
Answer: [1, 2, 3, 4]
In class: Complete a PCEP-format diagnostic exam (multiple-choice, fill-in-the-blank code output, and code-ordering questions); score results and map each missed question to the official PCEP exam syllabus section in the gap-tracking spreadsheet. · In a live Python coding lab, work through instructor-written exercises that target the three lowest-scoring syllabus sections; for each exercise students predict output before running code, then explain the discrepancy if any, reinforcing understanding of operator precedence, scope, and list/dict behavior. · Build a one-page Python cheat sheet covering syntax rules, built-in functions, and common pitfalls most frequently tested on the PCEP; swap cheat sheets with a partner for peer review, then take a 30-question timed practice set and compare answers.
Materials: Python Institute PCEP exam syllabus (download from pythoninstitute.org), Python 3 interpreter (local install or browser-based REPL such as repl.it), instructor-supplied coding exercises mapped to each syllabus section, practice question bank, students' own Course 3 Python notes.
Check: Post-diagnostic practice set score of 70% or higher; coding-lab exercises reviewed by instructor for correct output and appropriate code style; Python cheat sheet submitted. Pass mark: 70% on timed practice set and instructor sign-off on coding exercises.

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

PCEP — Python Basics (operator precedence)
1. What is the value of the expression `10 - 2 ** 3 + 1` in Python?
PCEP — Control Flow (range)
2. Which of the following correctly describes the behavior of `range(1, 8, 2)`?
PCEP — Functions (default parameter values)
3. What will the following code print? ```python def add(a, b=5): return a + b print(add(3)) ```
PCEP — Python Collections (list slicing)
4. A student writes the following code. What is the output? ```python my_list = [10, 20, 30, 40, 50] print(my_list[1:4]) ```
PCEP — Data Types and Type Casting
5. What is the result of `bool(0)` in Python?
PCEP — Functions (scope)
6. What error does the following code raise, and why? ```python def test(): print(y) y = 5 test() ```
PCEP — Python Collections (tuples)
7. Which statement about tuples is accurate?
PCEP — Control Flow (continue)
8. What is the output of the following code? ```python for i in range(3): if i == 1: continue print(i) ```
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.