About the Exam

PCAP-31-03 is the active associate-level Python Institute certification exam. It tests the ability to design, write, debug, and refactor multi-module Python programs, with coverage of modules and packages, exception handling, strings, object-oriented programming, list comprehensions, lambdas, closures, and file I/O. The exam is intended for aspiring programmers, learners, and career changers who want to demonstrate intermediate Python proficiency for junior-level software development, data analysis, testing, and related roles.

Exam Topics

  • Modules and Packages12%
  • Exceptions14%
  • Strings18%
  • Object-Oriented Programming34%
  • Miscellaneous (List Comprehensions, Lambdas, Closures, I/O)22%

How to Use This Practice Exam

  1. Browse — Read each question, select your answer, and reveal the explanation.
  2. Exam Mode — Simulate real exam conditions with a timed session and score report.
  3. Learn Mode — Spaced repetition schedules questions you struggle with for long-term retention.

Download the Full Exam PDF

Get every question and answer in a clean, printable PDF built for offline study. Purchase once, keep permanent access, and re-download the latest version anytime.

Last updated July 27, 2026

Topic filter
Question status
Question sort
Questions per page

QuestionQ1

VerifiedObject-Oriented Programming

What is the expected outcome of the following code?

Question Image

Explanation

Double-underscore identifiers declared or referenced within a class are name-mangled. Both foo() calls update the shared _Class__Var, leaving it at 2; the first instance’s _Class__prop remains 1. Their sum is therefore 3.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ2

VerifiedObject-Oriented Programming

What is true about the bases attribute in Python?

Explanation

The __bases__ attribute belongs to a class and contains a tuple of its direct base classes. It is accessed on the class itself, not on an instance.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ3

VerifiedExceptions

What is the expected result of running the following code?

Question Image

Explanation

The dictionary literal is syntactically invalid because '2' and '3' are not written as key: value entries. Python raises a SyntaxError while parsing the code, before the try/except statement can handle anything.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ4

VerifiedExceptions

What behavior is expected from the following code?

Question Image

Explanation

A three-element list has indices 0 through 2. Assigning a value to index 3 raises IndexError; the except BaseException handler catches it and prints list assignment index out of range.

Community Discussion

No comments yet. Be the first to start the discussion!

QuestionQ5

VerifiedMiscellaneous (List Comprehensions, Lambdas, Closures, I/O)

What output is expected from the following code when the file named zero_length_existing_file is a zero-length file in the working directory?

Question Image

Explanation

For a text stream already at end-of-file, readline() returns an empty string. The length of that string is 0, so print(len(d)) prints 0; opening the existing file does not raise IOError.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!
Know a question that should be here? Contribute to this exam
Back home