Free PCAP-31-03 Sample Questions — Certified Associate in Python Programming

Certified Associate in Python Programming (PCAP-31-03) is a associate-level Python Institute certification exam. The blueprint splits the exam across 5 domains, starting with Python Essentials, Data Structures, OOP. On exam day you face around 40 questions in 65 minutes, in formats such as multiple-choice. The 15 questions below are free samples written to match that style: answer each one first, then reveal the correct answer and note which topics you miss. The PCAP-31-03 is rated medium in difficulty, and most candidates prepare with at least 6 months of hands-on experience. Because every answer is revealed in place, you can work through the whole set without leaving this page. Work through all 15 samples before deciding whether to buy the full 57+ question PDF.

  • 15 free questions
  • 65 min
  • $295 official fee
  • blueprint v31-03
  • Every free question shows the correct answer
  • Questions follow the official 5-domain blueprint
  • No account or email required
  • 57+ questions in the full PDF

Looking for more? Click here to get the full PDF with 57+ practice questions for $10 for offline study and deeper preparation.

Question 1

Which of the following lambda definitions are correct? (Choose two.)

  • A. lambda(x,y) = x//y - x%y
  • B. lambda x,y: return x//y - x%y
  • C. lambda x,y: (x,y)
  • D. lambda x,y: x//y - x%y
Show Answer
Correct Answer:
  • C. lambda x,y: (x,y)
  • D. lambda x,y: x//y - x%y
Question 2

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 pyvar pyvar ()
  • B. import pymod pymod.pyvar = 1
  • C. import pyvar from pymod pyvar = 1
  • D. from pymod import* pyvar = 1
Show Answer
Correct Answer:
  • B. import pymod pymod.pyvar = 1
  • D. from pymod import* pyvar = 1
Question 3

What is true about Object-Oriented Programming in Python? (Choose two.)

  • A. an object is a recipe for a class
  • B. the arrows on a class diagram are always directed from a superclass towards its subclass
  • C. encapsulation allows you to protect some data from uncontrolled access
  • D. inheritance is the relation between a superclass and a subclass
Show Answer
Correct Answer:
  • C. encapsulation allows you to protect some data from uncontrolled access
  • D. inheritance is the relation between a superclass and a subclass
Question 4

What is true about Python packages? (Choose two.)

  • A. a code designed to initialize a package’s state should be placed inside a file named init.py
  • B. a package’s contents can be stored and distributed as an mp3 file
  • C. __pycache__ is a folder that stores semi-compiled Python modules
  • D. the sys.path variable is a list of strings
Show Answer
Correct Answer:
  • C. __pycache__ is a folder that stores semi-compiled Python modules
  • D. the sys.path variable is a list of strings
Question 5

What is the expected output of the following code? import sys import math b1 = type(dir(math)[0]) is str b2 = type(sys.path[-1]) is str print(b1 and b2)

  • A. False
  • B. True
  • C. 0
  • D. None
Show Answer
Correct Answer:
B. True
Question 6

A Python package named pypack includes a module named pymod.py which contains a function named pyfun(). Which of the following snippets will let you invoke the function? (Choose two.)

  • A. from pypack.pymod import pyfun pyfun()
  • B. import pypack pymod.pyfun()
  • C. from pypack import * pyfun()
  • D. import pypack import pypack.pymod pypack.pymod.pyfun()
Show Answer
Correct Answer:
  • A. from pypack.pymod import pyfun pyfun()
  • D. import pypack import pypack.pymod pypack.pymod.pyfun()
Question 7

Assuming that the math module has been successfully imported, which of the following expressions evaluate to True? (Choose two.)

  • A. math.ceil(2.5) == math.trunc(2.5)
  • B. math.ceil(2.5) < math.floor(2.5)
  • C. math.floor(2.5) == math.trunc(2.5)
  • D. math.hypot(3,4) == math.sqrt(25)
Show Answer
Correct Answer:
  • C. math.floor(2.5) == math.trunc(2.5)
  • D. math.hypot(3,4) == math.sqrt(25)
Question 8

What is true about Python class constructors? (Choose two.)

  • A. the constructor is a method named __init__
  • B. there can be more than one constructor in a Python class
  • C. the constructor must return a value other than None
  • D. the constructor must have at least one parameter
Show Answer
Correct Answer:
  • A. the constructor is a method named __init__
  • D. the constructor must have at least one parameter
Question 9

What is the expected output of the following code? import sys import math b1 = type(dir(math)) is list b2 = type(sys.path) is list print(b1 and b2)

  • A. None
  • B. True
  • C. 0
  • D. False
Show Answer
Correct Answer:
B. True
Question 10

Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Choose two.) string = 'REPTILE'[:3:] string = string[-1] + string[-2::-1]

  • A. len(string) == 3
  • B. string[0] == 'E'
  • C. string[0] < string[-1]
  • D. string is None
Show Answer
Correct Answer:
  • A. len(string) == 3
  • C. string[0] < string[-1]
Question 11

Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Choose two.) string = 'python'[::2] string = string[-1] + string[-2]

  • A. len(string) == 3
  • B. string[0] == 'o'
  • C. string[0] == string[-1]
  • D. string is None
Show Answer
Correct Answer:
B. string[0] == 'o'
Question 12

What is the expected output of the following code? import sys b1 type (dir(sys)) is str b2 type (sys.path[-1]) is str print (b1 and b2)

  • A. True
  • B. False
  • C. 0
  • D. None
Show Answer
Correct Answer:
B. False
Question 13

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
Show Answer
Correct Answer:
  • A. len(string) == 1
  • C. string[0] == string[-1]
Question 14

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

  • A. 'in not' in 'not'
  • B. 'a' not in 'ABC'.lower()
  • C. 'not' not in 'in'
  • D. 't'.upper() in 'Thames'
Show Answer
Correct Answer:
  • C. 'not' not in 'in'
  • D. 't'.upper() in 'Thames'
Question 15

What is true about lambda functions? (Choose two.)

  • A. they are called anonymous functions
  • B. they cannot return the None value as a result
  • C. they must contain the return keyword
  • D. they must have a non-zero number of parameters
Show Answer
Correct Answer:
  • A. they are called anonymous functions
  • D. they must have a non-zero number of parameters

PCAP-31-03 sample questions FAQ

Are these PCAP-31-03 sample questions from the real exam?

No. They are original practice questions written to match the format and topic mix of the Certified Associate in Python Programming exam, which contains around 40 questions. Treat them as representative practice, not leaked exam content.

How many free PCAP-31-03 sample questions do I get?

This page includes 15 questions, each with its correct answer you can reveal in place. The full study PDF expands that to 57+ questions.

Do the sample questions include the correct answers?

Yes. Open the answer panel under each question to see which option is correct. Answer first, then reveal, so the set works as a self-check rather than a reading exercise.

Is 15 sample questions enough to pass the PCAP-31-03?

Not on its own. Use the samples to find weak topics, revise them against the official domains, then work through the full 57+ question set under timed conditions before booking the exam.

Aced these? Get the Full Exam

Download the complete PCAP-31-03 study bundle with 57+ questions in a single printable PDF.