Customize this training

Get a certificate — $15$5

PCEP Certified Entry-Level Python Programmer (PCEP-30-03): Exam Prep

PCEP Certified Entry-Level Python Programmer (PCEP-30-03): Exam Prep

Prepare for the PCEP-30-03 exam: read and trace Python code, predict output, and handle data collections, functions, exceptions, files and the math and random modules.

What you will learn

  • Describe the PCEP-30-03 exam and explain how Python code is structured, interpreted and named (keywords, indentation, literals, variables)
  • Evaluate expressions with arithmetic, string, relational and Boolean operators, and use print(), input() and type conversion
  • Trace conditional blocks and while/for loops, including range(), nested loops, break, continue and pass
  • Create, index, slice, copy and modify lists, tuples and sets, including nested lists
  • Work with dictionaries and strings, using string methods and f-string, format() and % formatting
  • Define and call functions with all argument types, predict scope, and handle exceptions with try/except
  • Read, write and append text and CSV files, and import modules to use math and random functions

Modules

  1. The PCEP exam and Python fundamentals
  2. Operators, expressions and console I/O
  3. Control flow: conditions and loops
  4. Lists, tuples and sets
  5. Dictionaries, strings and formatting
  6. Functions, scope and exceptions
  7. Files and module imports

Course facts

Level
Exam preparation
Estimated study time
about 2 hours
Final assessment
42 questions · Pass mark 70%
Available in
English, Français, العربية
Price
Free. Optional verifiable certificate: $5
Last updated
Published by
AMAADOR ACADEMY

Who this course is for

Students, career changers, data and IT beginners, and professionals who want an entry-level Python certificate and need structured practice before booking the PCEP exam.

Prerequisites

No prior certificate. You should have written a few small Python programs; access to Python 3 on a computer helps you test the examples.

Course content

1. The PCEP exam and Python fundamentals

PCEP (Certified Entry-Level Python Programmer) is the first certificate of the Python Institute, run by OpenEDG. In November 2026 the Python Institute's own PCEP page and syllabus page describe the current exam version PCEP-30-03 (blueprint version 1.5, last revised 2 November 2026). This course teaches that version only.

ItemPCEP-30-03 (official syllabus page)
Questions35
Time50 minutes
Passing score70%
Item typesSingle-select, multiple-select, interactive and scenario-based
SectionQuestionsWeight
1. Computer programming and Python fundamentals617%
2. Control flow: conditional blocks and loops823%
3. Data collections: lists, tuples, sets, dictionaries, strings926%
4. Functions and exceptions720%
5. File handling and module imports514%

Source: pythoninstitute.org/pcep and pythoninstitute.org/pcep-exam-syllabus, checked 18 November 2026. The Python Institute’s PCEP-30-02 page (pythoninstitute.org/pcep-30-02) says PCEP-30-03 was released on 31 October 2026 and that PCEP-30-02 stays available until its sunset date, 30 November 2027. Price and exam languages are not stated on these pages, so check them in the OpenEDG store when you book.

What changed compared with earlier versions: sets, the walrus operator, CSV files and the math and random modules are now in the syllabus. Section 5 is new.

2. Operators, expressions and console I/O

Most section 1 questions ask you to evaluate one expression exactly. Learn these results by heart.

ExpressionResultWhy
7 / 23.5/ always returns a float
6 / 23.0still a float
7 // 23floor division
-7 // 2-4rounds down, towards minus infinity
7 % 31remainder
-7 % 32result takes the sign of the divisor
7.0 // 23.0a float operand gives a float
2 ** 3 ** 2512** is right-associative: 3 ** 2 first
-2 ** 2-4** binds tighter than unary minus
'ab' * 3'ababab'string replication
'4' + '2''42'string concatenation
  1. ** (right to left)
  2. unary + and -
  3. * / // % (left to right)
  4. + -
  5. comparisons == != > >= < <=
  6. not, then and, then or

Compound assignment operators (+=, -=, *=, /=, //=, %=, **=) update a variable in place: after x = 5 and x //= 2, x is 2.

and and or short-circuit and return one of their operands, not necessarily True or False: 0 or 5 gives 5, 3 and 0 gives 0. not always returns a bool. Comparisons can be chained: 1 < x < 10 means 1 < x and x < 10.

3. Control flow: conditions and loops

An if block runs only when its condition is truthy. elif adds more conditions, and else catches everything left. In an if-elif-else chain, Python tests the conditions from top to bottom and runs only the first branch that matches; the rest are skipped.

score = 85
if score >= 50:
    print('pass')
elif score >= 80:
    print('merit')
else:
    print('fail')

This prints only pass. The elif branch is unreachable for any score of 80 or more, because the first condition already caught it. The fix is to test the most specific condition first (>= 80, then >= 50).

SituationWhat happens
Several separate if statementsEach one is tested; several can run
One if-elif-elif chainAt most one branch runs
Chain with elseExactly one branch runs
Condition is 0, '', [], NoneTreated as False

Compound conditions combine tests with and, or, not. Remember the order: not first, then and, then or. So a or b and c means a or (b and c). Nested conditions put an if inside another if; the inner one is tested only when the outer one is true.

4. Lists, tuples and sets

A list is an ordered, mutable collection: nums = [10, 20, 30, 40, 50]. Indexes start at 0; negative indexes count from the end.

ExpressionResult
nums[0], nums[-1]10, 50
nums[1:3][20, 30] (stop excluded)
nums[:2], nums[3:][10, 20], [40, 50]
nums[::2][10, 30, 50]
nums[::-1][50, 40, 30, 20, 10]
nums[2:99][30, 40, 50] (slices never raise IndexError)
nums[5]IndexError
len(nums), 30 in nums5, True

Copying: b = nums does not copy; both names point to the same list, so b.append(60) also changes nums. A real (shallow) copy is nums[:], list(nums) or nums.copy().

OperationEffect
append(x)adds x at the end
insert(i, x)inserts x before index i
index(x)position of the first x; ValueError if absent
remove(x)deletes the first x; ValueError if absent
del nums[i], del nums[1:3]deletes by position or slice
sorted(nums)returns a new sorted list; nums is unchanged
nums.sort()sorts in place and returns None

Remember: x = nums.sort() leaves x equal to None. Methods that change a list in place (append, insert, remove, sort) return None.

5. Dictionaries, strings and formatting

A dictionary maps unique keys to values: stock = {'pens': 40, 'files': 12}. Since Python 3.7, dictionaries keep the order in which keys were inserted. Keys must be immutable (str, int, tuple); values can be anything.

CodeResult
stock['pens']40
stock['ink']KeyError
stock.get('ink')None, no error
stock.get('ink', 0)0 (the default you give)
stock['ink'] = 5adds a new key
stock['pens'] = 35updates an existing key
del stock['files']removes the key; KeyError if missing
stock.pop('pens')removes the key and returns its value
'pens' in stocktests the keys, not the values
{'a': 1, 'a': 2}{'a': 2}: the last duplicate wins

Views: keys(), values() and items() give views you can loop over. items() produces (key, value) tuples, so you can unpack them:

for name, qty in stock.items():
    print(name, qty)

A plain for k in stock loops over the keys. len(stock) counts key-value pairs. Values can be lists or other dictionaries, so you may see nested access such as staff['ops']['lead'].

Do

  • Use get() when a key may be missing
  • Use items() when you need both key and value

6. Functions, scope and exceptions

A function is defined with def, a name, parameters in brackets and a colon. Its body is indented. The function must be defined before the line that calls it runs; calling it earlier raises NameError.

def area(w, h):
    return w * h

print(area(3, 4))

This prints 12. return ends the function immediately and sends a value back to the caller. Any line after return in the same block never runs.

Function bodyWhat the caller receives
return w * hthe product
return (no value)None
no return statement at allNone
return a, ba tuple (a, b), which can be unpacked: x, y = f()
print(w * h) onlythe value is shown on screen, but the caller gets None

Do

  • return a value when the caller needs to use it
  • Call a function with brackets: area(3, 4)

Don't

  • Confuse print() inside a function with return
  • Forget the brackets: print(area) shows the function object, not a result

A classic exam trap: def f(): print('A') followed by x = f() and print(x). The output is A on the first line and None on the second, because f prints and then returns nothing.

7. Files and module imports

Section 5 is new in PCEP-30-03. It starts with open(name, mode), which returns a file object.

ModeMeaningIf the file does not existIf it exists
'r' (default)readFileNotFoundErrorreads from the start
'w'writecreates iterases its content first
'a'appendcreates itadds at the end

Always prefer the with statement: the file is closed automatically when the block ends, even if an exception occurs.

with open('log.txt', 'a') as f:
    f.write('check OK\n')

CallReturns
f.read()the whole file as one string
f.readline()the next line, including its '\n'; '' at the end of the file
f.readlines()a list of all lines
for line in f:one line per pass, with its '\n'
f.write(text)the number of characters written; no newline is added

Do

  • Use line.strip() to remove the trailing newline
  • Write str(value) for numbers: f.write(5) raises TypeError

Don't

  • Open an existing report in 'w' when you meant to add to it
  • Read from a file after the with block has closed it (ValueError)

Remember: 'w' truncates, 'a' appends, 'r' fails if the file is missing. Writing to a file opened with 'r' raises io.UnsupportedOperation.

The full lesson continues in the interactive course on this page.

Sources and references

Unofficial practice course. Not affiliated with, endorsed by or sponsored by the Python Institute or OpenEDG. PCEP is a trademark of its owner. Check the current exam outline on the Python Institute's website before you book.

All courses · Data Engineering & Analytics — Free certified training | AMAADOR ACADEMY