All Practice Exams

100+ Free PCAP Practice Questions

Pass your OpenEDG PCAP — Certified Associate in Python Programming (PCAP-31-03) exam on the first try — instant access, no signup required.

✓ No registration✓ No credit card✓ No hidden fees✓ Start practicing immediately
~65-75% Pass Rate
100+ Questions
100% Free
1 / 10
Question 1
Score: 0/0

In the package layout below, which file marks `mypkg` as a regular Python package? mypkg/ __init__.py utils.py

A
B
C
D
to track
2026 Statistics

Key Facts: PCAP Exam

40

Exam Questions

OpenEDG

70%

Passing Score

OpenEDG (cumulative)

65 min

Exam Duration

OpenEDG

$295

Exam Fee

OpenEDG

~34%

OOP Domain

Largest domain

Lifetime

Validity

Does not expire

PCAP-31-03 has 40 questions in 65 minutes with a 70% passing score. Domains: Modules and Packages (~12%), Exceptions (~14%), Strings (~18%), Object-Oriented Programming (~34%), and Miscellaneous — list comprehensions, lambdas, closures, generators, iterators, file I/O (~22%). PCEP is recommended but not required. Lifetime certification with no expiration. Exam fee $295 USD. Delivered online via the OpenEDG Testing Service.

Sample PCAP Practice Questions

Try these sample questions to test your PCAP exam readiness. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ question experience with AI tutoring.

1In the package layout below, which file marks `mypkg` as a regular Python package? mypkg/ __init__.py utils.py
A.utils.py
B.__init__.py
C.setup.py
D.__main__.py
Explanation: `__init__.py` (even if empty) marks a directory as a regular Python package, allowing `import mypkg` and `from mypkg import utils`. (Since Python 3.3, namespace packages are also possible without `__init__.py`, but PCAP focuses on regular packages.) `__main__.py` makes a package executable via `python -m mypkg`.
2What does this snippet print when run as the main script? if __name__ == '__main__': print('main') else: print('imported')
A.main
B.imported
C.main imported
D.Nothing
Explanation: When a script is run directly (e.g., `python myfile.py`), Python sets `__name__` to `'__main__'`. When the same file is imported as a module from another file, `__name__` is set to the module's name. Since this is run as the main script, 'main' is printed.
3Which import style triggers a circular import only at the module-load time?
A.from x import func
B.import x; x.func()
C.import x.y
D.Both A and B
Explanation: `from x import func` requires `func` to exist at import time, which can fail if `x` is in the middle of loading (circular import). `import x; x.func()` defers attribute access — `x` is just bound as a name, and `x.func` is resolved only when called. So `import x` is more circular-safe than `from x import name`.
4Which standard library module would you use to generate cryptographically secure random tokens?
A.random
B.secrets
C.math
D.os
Explanation: The `secrets` module (added in Python 3.6) is designed for cryptographically secure random numbers, useful for tokens, passwords, and security-sensitive purposes. `random` is fine for simulations and games but is NOT cryptographically secure. PCAP tests recognition of `random`, `math`, `platform`, and other selected standard library modules.
5What does this code print? import math print(math.floor(-2.3), math.ceil(-2.3))
A.-2 -3
B.-3 -2
C.-2 -2
D.-3 -3
Explanation: `math.floor(x)` returns the largest integer ≤ x. For -2.3, that's -3 (further from zero). `math.ceil(x)` returns the smallest integer ≥ x. For -2.3, that's -2 (closer to zero). PCAP often tests floor/ceil with negative numbers because the rule 'rounds toward negative infinity' surprises beginners.
6What does the following snippet output? import platform print(type(platform.python_version()).__name__)
A.int
B.tuple
C.str
D.float
Explanation: `platform.python_version()` returns the Python version as a STRING (e.g., '3.11.4'). To get a tuple of integers, use `platform.python_version_tuple()`. PCAP tests both — the string form is more commonly used.
7Which statement is TRUE about the Python exception hierarchy?
A.Exception is the root of the entire hierarchy
B.BaseException is the root of all built-in exceptions
C.KeyboardInterrupt inherits from Exception
D.SystemExit cannot be caught
Explanation: `BaseException` is the ROOT — `Exception`, `KeyboardInterrupt`, `SystemExit`, and `GeneratorExit` all inherit from `BaseException` directly. User code typically catches `Exception` (not `BaseException`), so `KeyboardInterrupt` and `SystemExit` are NOT caught by `except Exception`. They CAN be caught explicitly.
8What does this code print? try: raise ValueError('a') except ArithmeticError: print('arith') except Exception: print('exc')
A.arith
B.exc
C.ValueError
D.Nothing
Explanation: `ValueError` does NOT inherit from `ArithmeticError` (which is for ZeroDivisionError, OverflowError, FloatingPointError). It DOES inherit from `Exception`. So the second handler catches it, printing 'exc'.
9What does this code print? class MyError(Exception): pass try: raise MyError('boom') except MyError as e: print(e)
A.MyError
B.boom
C.Exception
D.Error
Explanation: To define a custom exception, simply subclass `Exception` (not `BaseException`). `raise MyError('boom')` creates an instance with 'boom' as args[0]. Printing the exception object calls its __str__, which returns the message — so 'boom' is printed.
10What does this snippet output? try: try: raise ValueError('inner') except ValueError: raise TypeError('outer') except TypeError as e: print(e, e.__context__)
A.outer None
B.outer inner
C.inner outer
D.TypeError
Explanation: When an exception is raised while handling another, Python automatically sets `__context__` to the original exception. So `e` is the TypeError 'outer', and `e.__context__` is the ValueError 'inner'. Printing both: `outer inner`. (To suppress context: `raise TypeError('outer') from None`.)

About the PCAP Exam

The OpenEDG PCAP-31-03 (Certified Associate in Python Programming) exam validates the ability to design, write, debug, and maintain multi-module Python 3 programs using object-oriented programming. Topics include modules and packages, exceptions hierarchy, advanced string processing, OOP (inheritance, polymorphism, encapsulation), iterators and generators, closures, lambdas, and file I/O.

Questions

40 scored questions

Time Limit

65 min

Passing Score

70%

Exam Fee

$295 (OpenEDG / OpenEDG Testing Service)

PCAP Exam Content Outline

~12%

Modules and Packages

import variants (import x, from x import y, as), sys.path and PYTHONPATH, __name__ == '__main__', package structure with __init__.py, relative vs absolute imports, selected standard library modules (math, random, platform), pip basics

~14%

Exceptions

Built-in exception hierarchy (BaseException, Exception, ArithmeticError, LookupError, etc.), try / except / else / finally, raise and raise from, defining custom exception classes, exception chaining, the Exception object's args attribute

~18%

Strings, String Processing, and Character Encoding

ASCII vs Unicode (UTF-8/UTF-16), ord() and chr(), string methods (lower, upper, title, capitalize, strip, lstrip, rstrip, replace, split, join, find, rfind, index, count, startswith, endswith, isalpha, isdigit, isalnum), string comparison, escape sequences

~34%

Object-Oriented Programming

class and instance, attributes vs methods, __init__ / __del__ / __str__ / __repr__ / __eq__, single vs double underscore (encapsulation, name mangling), inheritance and MRO, super(), polymorphism, isinstance() / issubclass(), @classmethod / @staticmethod, @property, __dict__, __slots__

~22%

Miscellaneous (Comprehensions, Lambdas, Closures, Generators, File I/O)

list and dict comprehensions, lambda expressions, map() / filter(), closures (free variables, nonlocal), iterators (__iter__, __next__), generator functions (yield) and generator expressions, file I/O (open, read, write, with), text vs binary mode, FileNotFoundError, PermissionError

How to Pass the PCAP Exam

What You Need to Know

  • Passing score: 70%
  • Exam length: 40 questions
  • Time limit: 65 min
  • Exam fee: $295

Keys to Passing

  • Complete 500+ practice questions
  • Score 80%+ consistently before scheduling
  • Focus on highest-weighted sections
  • Use our AI tutor for tough concepts

PCAP Study Tips from Top Performers

1Master the dunder methods: __init__, __del__, __str__, __repr__, __eq__ — and know when each is called
2Single underscore = convention only (still accessible); double underscore = name mangled to _ClassName__attr
3MRO (Method Resolution Order) follows C3 linearization — use ClassName.__mro__ or .mro() to inspect
4super() called with no args inside a method resolves to the parent class — required for cooperative multiple inheritance
5Generators with yield are lazy — they don't execute until next() is called or the generator is iterated
6Closures capture variables by reference, not by value — late binding can surprise you in loops
7open() returns a file object; always use 'with' to guarantee close even on exceptions
8Exception hierarchy: BaseException > Exception > (ArithmeticError, LookupError, OSError, etc.) — order specific to general
9Use the free Python Essentials 2 course on edube.org — it is the official PCAP prep material

Frequently Asked Questions

What is the PCAP-31-03 exam?

PCAP-31-03 is the OpenEDG Certified Associate in Python Programming exam administered by the OpenEDG Python Institute. It validates the ability to design, write, and debug multi-module Python 3 programs using object-oriented programming, modules, packages, exceptions, strings, file I/O, generators, closures, and lambdas.

How many questions are on the PCAP exam?

PCAP-31-03 has 40 questions in 65 minutes. Item types include single-select, multiple-select, drag-and-drop, gap-fill, code insert, and code order. The passing score is a cumulative 70%. Most questions present a Python 3 code snippet and ask you to predict its output, identify the error, or complete the code.

Is PCEP required before PCAP?

No — PCEP is recommended but not required. You can take PCAP-31-03 directly. However, PCAP assumes everything PCEP covers (variables, types, control flow, basic data collections, functions, basic exceptions) and goes deeper, so most candidates pass PCEP first or have equivalent self-study experience.

What is the largest domain on the PCAP exam?

Object-Oriented Programming is the largest domain at approximately 34% of the exam. You must master class definition, __init__ and other dunder methods, single vs double underscore encapsulation and name mangling, inheritance with super() and MRO, polymorphism, isinstance() / issubclass(), @classmethod / @staticmethod, and @property.

How should I prepare for the PCAP exam?

Plan for 60-100 hours of study over 6-12 weeks. Use the free Python Essentials 2 (PE2) course on Edube Interactive — it aligns directly with PCAP-31-03 objectives. Build at least one multi-module OOP project (e.g., a small inventory manager). Complete 100+ practice code questions and aim for 80%+ before scheduling the real exam.

What jobs can I get with PCAP certification?

PCAP demonstrates associate-level Python proficiency and supports roles such as Junior/Mid Python Developer, Backend Developer, Data Engineer trainee, QA Automation Engineer, DevOps Engineer (Python tooling), and ML Engineer trainee. PCAP is widely recognized in job postings as proof of OOP and multi-module Python ability.