๐ŸŽ„

CertoMetrics - 9% OFF Special Discount Offer - Ends In:

0d 00h 00m 00s
Coupon code: SALE2026

Python Institute PCAP โ€“ Certified Associate in Python Programming (PCAP-31-03)

Get full access to the updated question bank and pass on your first attempt.

Vendor

Python Institute

Certification

General-Purpose

Content

109 Qs

Status

Verified

Updated

1 day ago

Test the Practice Engine

Experience our real exam environment with free demo questions

Launch Free Demo
Best Value Bundle

Premium Bundle

Complete Success Suite

$108 $69

Save $39 Instantly

  • โœ“
    Full PDF + Interactive Engine Everything you need to pass
  • โœ“
    All Advanced Question Types Drag & Drop, Hotspots, Case Studies
  • โœ“
    Priority 24/7 Expert Support Direct line to certification leads
  • โœ“
    90 Days Free Priority Updates Stay current as exams change

Success Metric

98.4% Pass Rate

Verified by 15k+ Students
Secure Checkout
Popular

Standard Simulation

Practice Engine

$59

One-Time Payment

  • Web-Based (Zero Install)
  • Real Testing Environment Virtual & Practice Modes
  • Interactive Engine Drag & Drop, Hotspots
  • 60 Days Free Updates

Compatible with All Devices

Chrome
Verified Secure Checkout

Basic Tier

PDF Study Guide

$49

Digital Access

  • โœ“ Exam Questions (PDF)
  • โœ“ Mobile Friendly
  • โœ“ 60 Days Updates
Download Free Sample PDF

Verified 10-Question Preview

Secure Checkout

Verified Community

The CertoMetrics Standard.

Recommend the #1 platform for verified Python Institute certification resources.

Success Network

Help a Colleague Succeed.

Invite a peer to get their own updated PCAP-31-03 prep kit.

Exam Overview

The Certified Associate in Python Programming (PCAP-31-03) certification is a globally recognized credential that validates your intermediate to advanced proficiency in Python. Achieving PCAP status signifies a robust understanding of core Python concepts, object-oriented programming, modules, packages, and advanced data structures, moving beyond foundational knowledge. This certification is a critical stepping stone for professionals aiming to solidify their Python expertise, demonstrating to employers a readiness to tackle complex programming challenges. It significantly enhances your professional profile, opening doors to diverse career opportunities in software development, data science, automation, and web development, and serves as a testament to your commitment to mastering the Python language.

Questions

40

Passing Score

700/1000

Duration

65 Minutes

Difficulty

Intermediate

Level

Associate

Skills Measured

Modules and Packages: Understanding how to create, use, and manage Python modules and packages, including standard library modules like os, sys, math, and time.
Object-Oriented Programming (OOP): Proficiency in defining and using classes, objects, inheritance, polymorphism, encapsulation, instance methods, class methods, and static methods.
Exception Handling: Implementing robust error handling using try-except-finally blocks, raising custom exceptions, understanding assert statements, and debugging techniques.
Advanced Data Structures and Comprehensions: Working with lists, tuples, dictionaries, and sets, alongside advanced techniques like list, dictionary, and set comprehensions, generators, and iterators.
File Input/Output (I/O) and String Processing: Reading from and writing to text and binary files, managing file streams, and utilizing regular expressions (re module) for complex string manipulation.

Career Path

Target Roles

Python Developer Automation Specialist Data Analyst

Common Questions

Is the material up to date?

Yes. We update our question bank weekly to match the latest Python Institute standards. You get free updates for 90 days.

What format do I get?

You get instant access to both the **PDF** (for reading) and our **Premium Test Engine** (for exam simulation).

Is there a guarantee?

Absolutely. If you fail the PCAP-31-03 exam using our materials, we offer a full money-back guarantee.

When do I get the download?

Instantly. The download link is available in your dashboard immediately after payment is confirmed.

Free Study Guide Samples

Previewing updated PCAP-31-03 bank (22 Questions).

QUESTION 1

What is true about the following snippet? (Choose two.)

A
the string what a pity will be seen
B
the string it's nice to see you will be seen
C
the code will raise an unhandled exception
D
the string I feel fine will be seen

Correct Option: B,D

โœ…

Reasoning: The raise E("what a pity") statement creates an E exception object. When print(e) is executed in the except block, Python calls the custom __str__ method of class E, which always returns "it's nice to see you".


โœ…

Reasoning: The print("I feel fine") statement is located at the beginning of the try block. It executes successfully before the raise E("what a pity") statement, printing "I feel fine" to the console. โŒ Why the other choices are incorrect:

  • Option A is incorrect: The __str__ method of class E overrides the default exception message, so "what a pity" (the message passed to __init__) is not printed when print(e) is called.
  • Option C is incorrect: The except E as e: block explicitly catches and handles the E exception. The exception is therefore handled, not unhandled.
QUESTION 2

What is the expected behavior of the following code?

A
it outputs 3
B
it outputs 1
C
it outputs 2
D
the code is erroneous and it will not execute

Correct Option: A

โœ…

Reasoning: m starts at 0. foo(0) is called. Inside foo, 1/0 raises ZeroDivisionError. The inner except ArithmeticError catches it, m becomes 1, and the error is re-raised. The outer except ArithmeticError then catches it, and m becomes 1 + 2 = 3. Finally, print(m) outputs 3. โŒ Why the other choices are incorrect:

  • Option B is incorrect: m changes multiple times due to exception handling. It's not 1.
  • Option C is incorrect: The m += 2 block executes, making the value 3, not 2.
  • Option D is incorrect: The code is syntactically correct and handles the ZeroDivisionError gracefully without terminating.
QUESTION 3

Which of the following expressions evaluate to True? (Choose two.)

A
ord("0") - ord("9") == 10
B
len("''") == 2
C
chr(ord('z') - 1) == 'y'
D
len(''1234'') == 4

Correct Option: B,C

โœ…

Reasoning: The string '' contains two single-quote characters. The len function correctly counts these two characters, so len("''") evaluates to 2. Therefore, 2 == 2 is True.


โœ…

Reasoning: ord('z') returns the ASCII/Unicode value of 'z' (122). ord('z') - 1 is 121. chr(121) converts this value back to the character 'y'. Thus, 'y' == 'y' is True. โŒ Why the other choices are incorrect:

  • Option A is incorrect: ord("0") is 48 and ord("9") is 57. The expression 48 - 57 equals -9. Since -9 == 10 is False, this choice is incorrect.
  • Option D is incorrect: The syntax ''1234'' is invalid in Python. It's interpreted as an empty string '' followed by the integer 1234 followed by another empty string '', leading to a SyntaxError.
QUESTION 4

Which of the following snippets will execute without raising any unhandled exceptions? (Choose two.)

A
options/PCAP3_a691496fe7.webp
B
options/PCAP3_ce5f8ea9c0.webp
C
options/PCAP3_05970d33ec.webp
D
options/PCAP3_37bbf92cb6.webp

Correct Option: A,B

โœ…

Reasoning: The try block attempts 1 / 0, raising a ZeroDivisionError. The subsequent except ZeroDivisionError: block specifically catches this exception. The pass statement handles it, preventing any unhandled exceptions from propagating.


โœ…

Reasoning: The try block performs 1 / 1, which executes successfully without raising any exceptions. Since no ZeroDivisionError occurs, the except block is skipped entirely. The program continues normally without unhandled exceptions. โŒ Why the other choices are incorrect:

  • Option C is incorrect: A ValueError is raised within the try block. The except TypeError: clause will not catch a ValueError because they are distinct, unrelated exception types. Thus, the ValueError remains unhandled.
  • Option D is incorrect: The function f raises a general Exception. The except IOError: clause is too specific to catch a general Exception. IOError is a subclass of OSError, not Exception itself directly. The Exception is unhandled.


QUESTION 5

What is the expected behavior of the following code?

A
the code is erroneous and it will not execute
B
it outputs 1
C
it outputs 2
D
it outputs 0

Correct Option: C

โœ…

Reasoning: The string s = '2A' cannot be converted to an integer by int(s), causing a ValueError. This specific exception is caught by the first except ValueError: block, which sets n to 2. The program then proceeds to print(n), outputting 2. โŒ Why the other choices are incorrect:

  • Option A is incorrect: The code includes try...except blocks specifically to handle potential errors, preventing a crash and ensuring execution proceeds to print a value.
  • Option B is incorrect: n would be 1 only if an ArithmeticError occurred. int('2A') raises a ValueError, not an ArithmeticError.
  • Option D is incorrect: n would be 0 only if a general, uncaught exception (not ValueError or ArithmeticError) occurred. The ValueError is specifically handled.
QUESTION 6

Which one of the platform module functions should be used to determine the underlying platform name?

A
platform.processor()
B
platform.uname()
C
platform.python_version()
D
platform.platform()

Correct Option: D

โœ…

Reasoning: platform.platform returns a single string identifying the underlying platform, including OS, version, and architecture. It directly provides the comprehensive platform name. โŒ Why the other choices are incorrect:

  • Option A is incorrect: platform.processor returns the processor's name (e.g., 'x86_64'), not the underlying platform's name.
  • Option B is incorrect: platform.uname returns a named tuple containing system information. While uname.system gives the basic OS name, the function itself returns a tuple, not a direct platform name string.
  • Option C is incorrect: platform.python_version returns the Python interpreter's version string, not the underlying platform's name.


QUESTION 7

With regards to the directory structure below, select the proper forms of the directives in order to import module_c. (Choose two.)

A
from pypack.upper.lower import module_c
B
import pypack.upper.lower.module_c
C
import upper.module_c
D
import upper.lower.module_c

Correct Option: A,B

โœ…

Reasoning: This directive correctly uses the from... import... statement. It specifies the full package path pypack.upper.lower to locate the lower subpackage, then imports the module_c module from within it.


โœ…

Reasoning: This directive correctly uses the import... statement. It provides the absolute, fully qualified name for module_c by traversing the package hierarchy: pypack -> upper -> lower -> module_c. โŒ Why the other choices are incorrect:

  • Option C is incorrect: import upper.module_c is incorrect because upper is not a top-level package; it's a subpackage of pypack. Furthermore, module_c is not directly inside upper, but rather inside upper.lower.
  • Option D is incorrect: import upper.lower.module_c is incorrect because upper is not a top-level package; it's nested within pypack. Python requires the full path from a package in sys.path.


QUESTION 8

Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Choose two.) import random v1 = random.random() v2 = random.random()

A
len(random.sample([1,2,3],1)) > 2
B
v1 == v2
C
random.choice([1,2,3]) > 0
D
v1>1

Correct Option: C

โœ…

Reasoning: random.choice([1,2,3]) will always return 1, 2, or 3. All these values are greater than 0. Therefore, the expression random.choice([1,2,3]) > 0 will always evaluate to True. โŒ Why the other choices are incorrect:

  • Option A is incorrect: random.sample([1,2,3], 1) returns a list containing one element, so its len is always 1. 1 > 2 is False.
  • Option B is incorrect: random.random generates pseudo-random floats. While theoretically possible, v1 == v2 is highly improbable and not guaranteed to be True.
  • Option D is incorrect: random.random returns a float x where 0.0 <= x < 1.0. Thus, v1 can never be greater than 1. v1 > 1 is always False.


QUESTION 9

A Python module named pymod.py contains a variable named pyvar. Which of the following snippets will let you access this variable? (Choose two.)

A
from pymod import pyvarpyvar ()
B
import pymodpymod.pyvar = 1
C
import pyvar from pymodpyvar = 1
D
from pymod import*pyvar = 1

Correct Option: B,D

โœ…

Reasoning: The import pymod statement imports the module pymod. After importing, variables within the module are accessed using dot notation: pymod.pyvar. The snippet correctly accesses pyvar and assigns it a new value.


โœ…

Reasoning: The from pymod import * statement imports all public names from pymod directly into the current namespace. This allows pyvar to be accessed directly by its name without a module prefix. The snippet then correctly accesses pyvar and assigns it a new value. โŒ Why the other choices are incorrect:

  • Option A is incorrect: While from pymod import pyvar is correct, pyvar attempts to call pyvar as a function, which is incorrect for a variable, resulting in a TypeError.
  • Option C is incorrect: The syntax import pyvar from pymod is invalid. The correct syntax for importing specific names is from pymod import pyvar.


QUESTION 10

What is the expected output of the following code if existing_file is the name of a file located inside the working directory?

A
1 2 3
B
1 2
C
1 3
D
2 3

Correct Option: C

โœ…

Reasoning: The open('existing_file', 'w') call on an existing file truncates it but does not raise an IOError. The try block completes successfully, printing 1. The except block is skipped. The else block then executes, printing 3. The final output is "1 3". โŒ Why the other choices are incorrect:

  • Option A is incorrect: The except block is not executed because no IOError occurs; therefore, 2 is not printed.
  • Option B is incorrect: 2 is in the except block, which is skipped. The else block, which prints 3, is executed.
  • Option D is incorrect: The try block successfully prints 1. The except block, which prints 2, is skipped.


QUESTION 11

What is the expected behavior of the following code?

A
the code is erroneous and it will not execute
B
it outputs 1
C
it outputs 3
D
it outputs 2

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 12

What is the expected behavior of the following code?

A
it outputs 3
B
the code is erroneous and it will not execute
C
it outputs 2
D
it outputs 1

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 13

Which of the following snippets will execute without raising any unhandled exceptions? (Choose two.)

A
options/PCAP3_5586d9e3e6.webp
B
options/PCAP3_4d8ba233de.webp
C
options/PCAP3_7b6a7fa0a3.webp
D
options/PCAP3_1bd0caff5e.webp

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 14

Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Choose two.)

A
hasattr(B, 'get')
B
isinstance(obj_b,
C
_C__VarA == 2
D

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 15

What is the expected behavior of the following code?

A
it outputs 2
B
it raises an exception
C
it outputs 1
D
it outputs 0

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 16

What is the expected output of the following code if there is no file named non_existing_file inside the working directory?

A
1 2 4
B
2 4
C
1 2 3 4
D
1 3

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 17

Which of the following statements are true? (Choose two.)

A
if invoking open() fails, the value None is returned
B
open() is a function which returns an int that represents a physical file handle
C
the second open() argument is optional
D
instd, outstd, errstd are the names of pre-opened streams

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 18

What is true about the __bases__ property?

A
there is no such property
B
it is accessible inside a class and an object
C
it is accessible inside a class
D
it is accessible inside an object

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 19

Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Choose two.)

string = 'SKY'[::-1]

string = string[-1]

A
len(string) == 1
B
string[0] == 'Y'
C
string[0] == string[-1]
D
string is None

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 20

Which of the following expressions evaluate to True? (Choose two.)

A
'abc'.upper() < 'abc'
B
'1'+'2' * 2 != '12'
C
3 * 'a' < 'a' * 2
D
11 == '011'

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 21

A Python module named pymod.py contains a function named pyfun().

Which of the following snippets will let you invoke the function? (Choose two.)

A
from pymod import *pymod.pyfun()
B
import pyfun from pymodpyfun()
C
import pymodpymod.pyfun()
D
from pymod import pyfunpyfun()

Premium Solution Locked

Unlock all 109 answers & explanations

QUESTION 22

What is the expected behavior of the following code?

 

 

A
it outputs -2
B
it outputs 2.0
C
it outputs 0.0
D
the code is erroneus and it will not execute

Premium Solution Locked

Unlock all 109 answers & explanations

Full Question Bank Locked

You have reached the end of the free study guide preview. Upgrade now to unlock all 109 questions and the full simulation engine.

Customer Reviews

5 / 5
(15,000+ verified)
5
100%
4
0%
3
0%
2
0%
1
0%

Global Community Feedback

DM

David M.

Verified Student

"The practice engine is incredible. It feels exactly like the real testing environment and helped me build so much confidence."

SJ

Sarah J.

Premium Member

"The PDF is very well organized and the explanations for the answers are actually helpful, not just random text."

MC

Michael C.

Verified Buyer

"I was skeptical, but the content is high quality and definitely worth the price. I passed on my first try!"

Need Assistance?

Our expert support team is available to assist you with any inquiries about our exam materials.

Contact Support
Average response: < 24 Hours

Get Exam Updates

Subscribe to receive instant notifications on new questions and exclusive flash sales.

* Join 5,000+ students getting weekly updates

Support Chat โ— Active Now

๐Ÿ‘‹ Hi! How can we help you pass your exam?

Enter email to start chatting