Black Friday Flash Sale:

50% OFF ALL PRODUCTS
Ends in--d--h--m--s
COUPON:BLACKFRIDAY50

PCAP-31-04 Exam Guide 2026 + 10 Free Practice Questions

PCAP-31-04 Certified Associate Python Programmer Practice Tests: 6 Practice Tests and 252 Questions
In this article

Python Institute  ·  PCAP-31-04 Certified Associate Python Programmer  ·  Updated November 2026

The PCAP-31-04 Certified Associate Python Programmer exam, from the OpenEDG Python Institute, tests whether you can design, analyse, test and improve intermediate Python programs using modules, exceptions, strings, object-oriented programming and modern development practice. It has 42 questions in 65 minutes, you need 72% to pass, and the credential is valid for 5 years. PCAP-31-04 replaces PCAP-31-03, which the Python Institute will retire on 30 November 2027, and it adds a new section on testing, debugging, collaborative development and AI assistance. This guide covers the format, the six sections and their weights, a 6-week study plan and 10 free PCAP-31-04 practice questions with answers.

At a glance

ExamPCAP™ – Certified Associate Python Programmer (PCAP-31-04)
Questions42
Time65 minutes
Passing score72%
Validity5 years
PrerequisiteNone (PCEP-level knowledge recommended)
  • Six weighted sections: 5, 5, 4, 12, 10 and 6 questions. Object-oriented programming is the largest at 28.5%.
  • Delivered online through TestNow™, the OpenEDG Testing Service. The fee is shown in the OpenEDG Store, not on the exam page.

Source: Python Institute PCAP certification page and PCAP-31-04 exam syllabus (blueprint version 1.5, revised 2 November 2026). Checked on 9 November 2026.

PCAP-31-04 exam format, questions and passing score

The PCAP-31-04 exam has 42 questions, a 65-minute time limit and a passing score of 72%. That gives you a little over 90 seconds per question, and the Python Institute says the exam emphasises code interpretation, so most of that time goes on reading code carefully.

The question types are single-select, multiple-select, interactive, code-based and scenario-based. Expect to trace short programs, predict output and spot the line that raises an error.

ItemDetail
Level and trackAssociate, General-Purpose Programming
Questions42, across six sections
Time65 minutes
Question typesSingle-select, multiple-select, interactive, code-based and scenario-based
Passing score72%
DeliveryTestNow™ (OpenEDG Testing Service), online with a proctor
FeeNot published on the PCAP-31-04 page; check current options in the OpenEDG Store
LanguagesNot published for PCAP-31-04
Credential validity5 years
RetakesWait 15 days after a failed attempt; a new voucher may be needed

Watch out

Study material written for PCAP-31-03 quotes 40 questions and a 70% pass mark. The comparison table below shows what changed.

Booking, results and retakes

You buy a voucher in the OpenEDG Store, sign in to your TestNow™ candidate account, redeem the voucher and complete check-in. TestNow™ runs in the browser on a desktop or laptop with a webcam and microphone; tablets and phones are not supported.

The Python Institute FAQ says global TestNow™ exams need no prior booking, and the PCAP testing policies let you start any time before your voucher expires. There are no scheduled breaks, and notes, books and phones are not allowed.

The score shown at the end is preliminary until the session passes review. Your score report, with a pass or fail result and a breakdown, then appears in the Exam History of your account. If you fail, you must wait 15 days before a retake, and there is no limit on the number of retakes.

PCAP-31-04 syllabus: six sections and their weights

The PCAP-31-04 syllabus has six sections and 42 objectives, with one question per objective. Object-oriented programming (12 questions, 28.5%) and advanced Python constructs and I/O (10 questions, 24%) make up more than half of the exam.

  • 1. Modules and Packages (12%): 5 questions. Import forms and aliases, namespaces, dir() and sys.path, user-defined modules and the __name__ == “__main__” pattern, packages and __init__.py, pip and requirements.txt.
  • 2. Exceptions (12%): 5 questions. Ordering except branches, else and finally, the exception hierarchy and args, raising and re-raising, propagation through function calls, custom exception classes.
  • 3. Strings (9.5%): 4 questions. ASCII, Unicode, UTF-8, ord() and chr(), immutability and comparisons, is…() validation methods, find(), index(), rfind(), rindex(), count() and sorted().
  • 4. Object-Oriented Programming (28.5%): 12 questions. Class and instance attributes, __dict__ and name mangling, methods and __str__(), introspection, single and multiple inheritance, MRO, isinstance() and identity, __init__() and super().
  • 5. Advanced Python Constructs and I/O (24%): 10 questions. List, set and dictionary comprehensions, match-case, loop else, lambdas, map() and filter(), closures, file modes and streams, bytearray and pathlib.
  • 6. Testing, Debugging, Collaborative Development, and AI Assistance (14%): 6 questions. Unit tests and assert, tracebacks and debugging, branches, commits, pull requests, code review and CI, AI-assisted coding and validating AI-generated code.

The Python Institute notes that these percentages are its published scoring weights and are not necessarily the same as each section’s share of the question count. Check the PCAP-31-03 vs PCAP-31-04 candidate guide (PDF) if you started studying for the older version.

Language core: modules, exceptions, strings and OOP (sections 1–4)

These four sections carry 26 of the 42 questions. They test whether you can predict exactly what Python does.

In object-oriented programming, know where Python looks up an attribute: the instance, then its class, then the rest of the method resolution order. The syllabus names class attributes hidden by instance attributes, name mangling, super() in a diamond hierarchy and mutable default arguments.

For exceptions, practise tracing try, except, else and finally together, including when a return statement sits inside them. For strings, learn which search methods return -1 and which raise ValueError.

Modern Python and real-world practice (sections 5–6)

Section 5 adds structural pattern matching with match-case, set and dictionary comprehensions and file handling with pathlib to the familiar lambdas, closures and file streams. All three are new in PCAP-31-04.

Section 6 is entirely new, with two questions each on testing and debugging, teamwork and collaboration, and AI-assisted development. The candidate guide says it is not a separate AI certification. It checks that you test your own code, read tracebacks, work through branches and code review, and never accept AI-generated code without checking it and protecting sensitive data.

Exametics practice tests

PCAP-31-04 Practice Tests: 6 tests, 252 questions

30-day refund. Instant access after payment.

Who should take PCAP-31-04 and what you need first

PCAP-31-04 is for people who already know Python basics and want to prove associate-level skill. There are no formal prerequisites, but the Python Institute recommends PCEP certification or equivalent knowledge first.

It suits junior developers, testers and analysts who write Python regularly, and PCEP holders ready for the next level. The Python Institute describes the minimally qualified candidate as someone who can build, analyse, test and maintain intermediate Python programs.

The free course aligned to the exam is Python Essentials 2 on Edube, the OpenEDG learning platform. The PCAP page also links official practice tests and exam bundles in the OpenEDG Store.

PCAP-31-04 vs PCEP and PCAP-31-03: which first?

If you are new to Python, start with PCEP, the entry-level exam, then take PCAP. If you are starting PCAP preparation now, the Python Institute recommends PCAP-31-04; PCAP-31-03 makes sense only if you have already prepared for it and can sit it before it retires on 30 November 2027.

ExamLevel and prerequisiteQuestions, time, pass mark
PCEP-30-03 Certified Entry-Level Python ProgrammerEntry; no prerequisites35 questions, 50 minutes, 70%
PCAP-31-03 Certified Associate Python Programmer (retires 30 November 2027)Associate; none, PCEP recommended40 questions, 65 minutes, 70%
PCAP-31-04 Certified Associate Python ProgrammerAssociate; none, PCEP recommended42 questions, 65 minutes, 72%

Sources: PCEP certification page, the PCAP-31-03 information page and the PCAP page linked above. Checked on 9 November 2026.

What changed from PCAP-31-03 to PCAP-31-04

PCAP-31-04 has two more questions, a higher pass mark and a new sixth section, and both versions award the same PCAP™ certification. Vouchers are not interchangeable between versions, so check the exam code on yours.

ItemPCAP-31-03PCAP-31-04
Questions and time40 in 65 minutes42 in 65 minutes
Passing score70%72%
Structure5 blocks6 sections
Strings questions84
Newly added topicsNot in this versionpip and requirements.txt, match-case, set and dictionary comprehensions, pathlib, testing, collaboration and AI assistance

Source: the Python Institute’s PCAP-31-03 vs PCAP-31-04 candidate guide (PDF, linked above). Checked on 9 November 2026.

The current PCEP exam is PCEP-30-03. Our PCEP certification preparation guide explains the entry level. After PCAP, the next step on the Python Institute’s general-purpose track is PCPP1; our PCPP-2 practice questions guide shows where the professional level leads.

Next on your Python Institute path

See all Python Institute practice tests →

A 6-week PCAP-31-04 study plan

Six weeks is a realistic plan if you already write Python and know PCEP-level basics. Spend most of it running and changing small programs, and finish with timed practice tests. Start with the 10 free practice questions below to find your weakest section.

  1. Week 1: Modules, packages and exceptions Sections 1 and 2. Build a small package with an __init__.py, import it in different ways and inspect sys.path. Use python -m pip and requirements.txt. Trace try, except, else and finally, and define your own exceptions.
  2. Week 2: Strings and object-oriented basics Section 3 and the start of section 4. Compare find() with index() on missing substrings, and test ord(), chr() and string comparisons. Write classes with class and instance attributes, inspect __dict__ and try name mangling.
  3. Week 3: Inheritance, MRO and initialisation The rest of section 4. Build a diamond hierarchy, print the __mro__ and follow super() calls. Use isinstance(), hasattr() and getattr(), and see what goes wrong with a mutable default argument in __init__().
  4. Week 4: Advanced constructs and files Section 5. Rewrite loops as list, set and dictionary comprehensions, write match-case statements, and practise closures, lambdas, map() and filter(). Read and write text and binary files with open() and with pathlib.
  5. Week 5: Testing, collaboration and AI assistance Section 6. Write assert-based tests with typical, boundary and invalid inputs, and read real tracebacks. Use a branch and a pull request on a small project, and check AI-suggested code by running it and looking up every function it calls.
  6. Week 6: Timed practice and review Take full 42-question PCAP-31-04 practice tests in timed Exam Mode, aiming to finish inside 65 minutes. Read every explanation and revisit the sections where you lose marks.

Tip

Predict the output on paper before you run any snippet. In the exam you cannot run code, so the skill you need is tracing in your head. Run the code afterwards only to check yourself.

Is PCAP-31-04 hard?

PCAP-31-04 is harder than PCEP: it is associate level, needs 72% rather than 70%, and its code tests detail such as attribute lookup, MRO and exception flow. Section 6 also covers testing, collaboration and AI-assisted coding, which many learners have not studied formally.

Planning more than one exam?

The Python Institute’s general-purpose track runs from PCEP to PCAP, PCPP1 and PCPP2, and its Testing track has PCET and PCAT. If more than one of these is on your list, the All-Access Pass covers every practice test on Exametics, including new exams as they are added, with lifetime access. It costs less than buying about six single practice tests.

Free PCAP-31-04 practice questions (10 with answers)

Try these 10 free PCAP-31-04 practice questions as a short practice test. They are original, spread across the six sections by weight, and every snippet was run in Python 3.12. Give yourself about 15 minutes, the real exam’s pace, then open each answer. The full Exametics PCAP-31-04 practice tests have 252 more sample questions in this style.

Practice question 1 · Modules and Packages

The file helper.py contains:
print(__name__, end=" ")
if __name__ == "__main__":
    print("run", end=" ")

The file main.py, in the same folder, contains:
import helper
import helper
print("done")

What does python main.py print?

  • A. helper done
  • B. helper helper done
  • C. __main__ run done
  • D. helper run done

Answer: A. When a module is imported, its __name__ is the module name, helper, so the if block does not run. Python runs a module’s code only on the first import; the second import helper reuses the module already loaded in sys.modules.

B is wrong because the module body is not executed a second time. C is wrong because __name__ is "__main__" only in the file you run directly, which is main.py. D is wrong because the "run" line needs __name__ == "__main__", which is false for an imported module.

Practice question 2 · Exceptions

What does this code print?
def f():
    try:
        return 1 / 0
    except ZeroDivisionError:
        print("E", end="")
        return 2
    else:
        print("L", end="")
    finally:
        print("F", end="")

print(f())

  • A. E2F
  • B. ELF2
  • C. EF2
  • D. EF followed by a ZeroDivisionError traceback

Answer: C. The division raises ZeroDivisionError, so the except branch prints E and prepares to return 2. Before the function actually returns, the finally block runs and prints F. Only then does print(f()) receive 2 and print it.

A is wrong because finally runs before the return value reaches the caller. B is wrong because else runs only when the try block finishes without an exception. D is wrong because the exception is handled by the except branch, so it does not propagate.

Practice question 3 · Strings

What does this code print?
s = "banana"
print(s.find("an", 2), s.rfind("x"), s.index("a", 2))

  • A. 1 -1 3
  • B. 3 -1 3
  • C. 3 -1 1
  • D. Nothing; rfind("x") raises ValueError

Answer: B. In "banana", "an" starts at indexes 1 and 3. Searching from index 2 finds the one at 3. rfind() returns -1 when the substring is absent, and index("a", 2) finds the first "a" at or after index 2, which is at index 3.

A is wrong because the start argument 2 skips the match at index 1. C is wrong for the same reason: index("a", 2) cannot return 1. D is wrong because only index() and rindex() raise ValueError for a missing substring; find() and rfind() return -1.

Practice question 4 · Object-Oriented Programming

What does this code print?
class Counter:
    count = 0
    def __init__(self):
        self.count += 1

a = Counter()
b = Counter()
Counter.count = 10
c = Counter()
print(a.count, b.count, c.count, Counter.count)

  • A. 1 2 3 3
  • B. 1 1 1 10
  • C. 10 10 11 11
  • D. 1 1 11 10

Answer: D. self.count += 1 reads count through the instance, finds the class attribute, adds 1 and then creates an instance attribute with the result. So a and b each get their own count of 1, and the class attribute stays 0. After Counter.count = 10, c reads 10 and stores 11 on itself, while the class still holds 10.

A is wrong because the class attribute is never increased. B is wrong because c is created after the class attribute changes to 10. C is wrong because a and b already have instance attributes that hide the class attribute.

Practice question 5 · Object-Oriented Programming

What does this code print?
class A:
    def who(self): return "A"
class B(A):
    def who(self): return "B" + super().who()
class C(A):
    def who(self): return "C" + super().who()
class D(B, C):
    pass

print(D().who())

  • A. BA
  • B. BCA
  • C. BACA
  • D. CBA

Answer: B. The method resolution order of D is D, B, C, A, object. super() means “the next class in the MRO of the object”, not “my parent”, so B’s method calls C’s, and C’s calls A’s. The result is "B" + "C" + "A".

A is wrong because it treats super() in B as always pointing to A. C is wrong because A appears only once in the MRO, so its method runs once. D is wrong because B is listed before C in class D(B, C), so B comes first.

Practice question 6 · Object-Oriented Programming

What does this code print?
class Account:
    def __init__(self):
        self.__pin = 1234

acc = Account()
print(hasattr(acc, "__pin"), hasattr(acc, "_Account__pin"))

  • A. False True
  • B. True False
  • C. True True
  • D. An AttributeError, because private attributes cannot be checked

Answer: A. A name with two leading underscores inside a class body is name-mangled: __pin is stored as _Account__pin. So the object has no attribute called __pin, but it does have _Account__pin.

B and C are wrong because no attribute named __pin exists after mangling. D is wrong because hasattr() returns False rather than raising an error, and name mangling only renames the attribute; it does not make it truly private.

Practice question 7 · Advanced Python Constructs and I/O

What does this code print?
grid = [[1, 2], [3, 4], [5, 6]]
print([x * 10 for row in grid for x in row if x % 2])

  • A. [20, 40, 60]
  • B. [[10], [30], [50]]
  • C. [10, 20, 30, 40, 50, 60]
  • D. [10, 30, 50]

Answer: D. The two for clauses run in the order written, like nested loops, so the comprehension visits 1, 2, 3, 4, 5 and 6 one by one and builds a flat list. The condition x % 2 is truthy only for odd numbers, which are multiplied by 10.

A is wrong because it keeps the even numbers, for which x % 2 is 0 and so false. B is wrong because a single comprehension with two for clauses produces a flat list, not a list of lists. C is wrong because it ignores the if filter.

Practice question 8 · Advanced Python Constructs and I/O

What does this code print?
def describe(p):
    match p:
        case (0, 0):
            return "origin"
        case (x, 0):
            return f"x-axis {x}"
        case (0, y):
            return f"y-axis {y}"
        case _:
            return "other"

print(describe((0, 0)), describe((3, 0)), describe([0, 5]))

  • A. origin x-axis 3 other
  • B. x-axis 0 x-axis 3 y-axis 5
  • C. origin x-axis 3 y-axis 5
  • D. A SyntaxError, because case patterns cannot contain variable names

Answer: C. Cases are tried from top to bottom, and (0, 0) matches the first case. (3, 0) fails the first case and matches (x, 0), binding x to 3. A sequence pattern written with parentheses matches lists as well as tuples of the right length, so the list [0, 5] matches (0, y) and binds y to 5.

A is wrong because sequence patterns match lists as well as tuples. B is wrong because the first matching case is used, and (0, 0) matches case (0, 0) before case (x, 0). D is wrong because a bare name in a pattern is a capture pattern that binds the matched value.

Practice question 9 · Testing, Debugging, Collaborative Development, and AI Assistance

A function must return True for ages 18 and over. A developer writes it and three test lines:
def is_adult(age):
    return age > 18

assert is_adult(30)
assert not is_adult(17)
assert is_adult(18)

What happens when the script runs?

  • A. The third assert raises AssertionError, exposing a boundary defect
  • B. The first assert raises AssertionError, because 30 is not checked
  • C. All three asserts pass, so the function is correct
  • D. The second assert raises AssertionError, because not cannot be used with assert

Answer: A. is_adult(30) is True and is_adult(17) is False, so the first two asserts pass. is_adult(18) returns False because 18 > 18 is false, so the third assert raises AssertionError. This is a logic error that only a boundary-value test catches; the fix is age >= 18.

B is wrong because 30 > 18 is True. C is wrong because the boundary case fails, which shows why tests should include boundary values as well as typical ones. D is wrong because assert not expression is valid, and here it passes.

Practice question 10 · Testing, Debugging, Collaborative Development, and AI Assistance

An AI coding assistant suggests rows = Path("sales.csv").read_csv() using pathlib. The file contains customer names and email addresses. What should the developer do?

  • A. Accept the line, because AI assistants are trained on the Python documentation
  • B. Check the method in the official pathlib documentation and run the code with tests before merging
  • C. Paste the whole customer file into the AI tool so it can fix the code
  • D. Ask the AI tool whether the method exists and merge the change if it says yes

Answer: B. The syllabus expects a human-in-the-loop approach: you verify that the modules and methods an AI tool suggests really exist, then run and test the code before using it. pathlib.Path offers methods such as read_text() and read_bytes(), but no read_csv(), so this line would raise AttributeError.

A is wrong because AI tools can invent methods that do not exist, and you stay responsible for the code. C is wrong because it shares personal data with an outside tool, which breaks the data-protection part of the objective. D is wrong because asking the same tool again is not independent validation.

How did you score?

8 to 10 correct: you are ready for a full 42-question test against the 65-minute clock. Under 8: each question shows its official section, so revise the sections you missed and try again. The PCAP-31-04 practice tests have 252 more questions like these, each with a hint and a full explanation.

PCAP-31-04 dumps vs practice tests

PCAP-31-04 dumps, like older PCAP-31-03 dumps, are question sets that claim to be copied from the live exam, and using them puts your certification at risk. Practice tests that explain every answer are the safer choice, because they build the code-tracing skill the exam actually measures.

Before the exam starts, you accept the Python Institute’s non-disclosure agreement and testing policies. They list “using brain dump materials” and sharing exam content by any means, including reconstruction from memory, as prohibited behaviour. Penalties can include a lifetime ban from future exams and the cancellation of all your earlier certifications.

Dumps are also unreliable. Their answers are often wrong or out of date, and memorised answers do not help when a question shows code you have not seen.

Good practice tests use original questions mapped to the official syllabus and explain every option, like the free questions above.

PCAP-31-04 Certified Associate Python Programmer FAQs

The PCAP-31-04 Certified Associate Python Programmer exam has 42 questions to answer in 65 minutes, according to the Python Institute’s PCAP page. The questions are spread over six sections with 5, 5, 4, 12, 10 and 6 questions.

The Python Institute sets the PCAP-31-04 passing score at 72%. The older PCAP-31-03 exam required 70%.

Yes. This guide includes 10 free PCAP-31-04 practice questions with answers and explanations, each labelled with its official exam section. For full timed practice, the Exametics PCAP-31-04 practice tests have six 42-question tests (252 questions) with every answer explained.

PCAP-31-04 is an associate-level exam with a 72% pass mark, and its questions ask you to trace code precisely, so it is harder than the entry-level PCEP. If you already write Python and know PCEP-level basics, about six weeks of hands-on study plus timed practice tests is a realistic plan.

The Python Institute recommends PCEP-level knowledge before PCAP, but PCEP is not a formal prerequisite. Its candidate guide recommends PCAP-31-04 if you are starting now, and PCAP-31-03 retires on 30 November 2027.

Yes. The Python Institute delivers PCAP-31-04 through TestNow™, its online proctored testing service, in a web browser. You need a desktop or laptop with a webcam and microphone, and the exam has no scheduled breaks.

The Python Institute’s PCAP page gives PCAP-31-04 a credential validity of 5 years. A PCAP credential you already hold keeps its original validity terms when a new exam version is released.

Official exam page: PCAP™ – Certified Associate Python Programmer (PCAP-31-04). Checked on 9 November 2026.

Start practising for PCAP-31-04

If the free questions showed gaps, practise with six 42-question tests (252 questions) that cover every PCAP-31-04 syllabus objective, with every answer explained and every code snippet checked in Python 3.12.

✓ Every answer explained  ·  ✓ Timed exam mode  ·  ✓ 30-day refund

Ready to test yourself?

Take timed, exam-style practice tests and see exactly which domains need more work before exam day.

Share this article

Leave a Comment

All-Access Pass
Practise for 800+ certification exams

Timed, exam-style tests with an explanation for every answer. Lifetime access.

₹18,856
Related practice tests
Practice Test
6 practice tests
600+ questions

Price range: ₹946 through ₹1,420

Select options This product has multiple variants. The options may be chosen on the product page
Practice Test
6 practice tests
280+ questions

Price range: ₹946 through ₹1,420

Select options This product has multiple variants. The options may be chosen on the product page
In this article

Keep reading

Get new exam guides in your inbox

One short email when we publish new guides and practice tests. No spam.

Shopping Cart
Scroll to Top