PCAP Tests Exact Output Prediction — Not Whether You Can Write Python
PCAP-31-03 rewards tracing snippets line by line: name binding, lookup order, return types. PCAP-31-04 was scheduled to replace it from 31 October 2026, so confirm which version you book.
Check Your Readiness →Most candidates understand PCAP – Certified Associate Python Programmer (PCAP-31-03) concepts — and still fail. This exam tests how you apply knowledge under pressure.
Nearly every item is a five-to-fifteen-line snippet: choose what it prints or which line raises. Multiple-select items ask for every valid statement. OOP alone is a third of the score, and distractors are built from habits that look right but differ by one detail such as 4 vs. 4.0.
It prints 3.141592653589793 because math was imported
The as clause binds only m, so the name math does not exist and the line raises NameError. List the exact names each import form binds before tracing; from-imports likewise never bind the module name.
print(map(...)) shows the list of computed values
map() and filter() return lazy iterators in Python 3, so printing one shows <map object at ...>. Only list() shows values; with n = 3, list(map(t, filter(lambda y: y > 1, [1, 2, 3]))) gives [6, 9].
It prints the balance because Python has no real privacy
Two leading underscores trigger name mangling to _ClassName__balance, so the plain name raises AttributeError. From outside the class, only the mangled form works, such as obj._Account__balance for a class named Account.
The output is the string error
args is always a tuple of constructor arguments, so it prints ('error',) with the trailing comma; print(e) shows just error. The name e is deleted when the handler ends, so using it afterwards raises NameError.
Augmented assignment through an instance reads the class value, then writes a new instance attribute. After c.n += 1 on class Cnt with n = 0, Cnt.n is still 0 and c.n is 1. Only Cnt.n += 1 changes the shared value.
For class D(B, C) where B and C both inherit A, D.__mro__ is D, B, C, A, object, so a method defined in C beats A. Listing a parent before its own subclass, as in class X(A, B) with B(A), raises TypeError.
Python runs the first matching except, top to bottom. With except ArithmeticError above except ZeroDivisionError, 1 / 0 prints the ArithmeticError branch. else is then skipped, and finally still runs, even after a return in try.
Defaults are evaluated once, when def runs. def f(x, L=[]) appends into the same list each call, so f(1) then f(2) returns [1, 2]. The idiom is L=None, then create the list inside the body.
Closures capture variables, not values, and look them up when called. [lambda: i for i in range(3)] gives three functions returning 2. Binding a default, lambda i=i: i, freezes each value; assigning to an outer name needs nonlocal or raises UnboundLocalError.
Strengthen weak areas with exam-style practice questions and detailed explanations.
Simulate the real exam experience and assess your readiness under timed conditions.
Review key concepts, objectives, and exam topics in one place.
Get personalized explanations, learning recommendations, and instant answers.
Follow a structured learning path designed to help you prepare efficiently.
PCAP marks exact output, down to 4 versus 4.0. Test your tracing on real gotchas.