Skip to content

Python Institute PCAP-31-03

Certified Associate in Python Programming

Verified practice questions with detailed answers, clear explanations, and community discussion.

  • 129

    questions

  • 1 day ago

    last updated

  • 4.8/5

    overall rating

Question 1 of 129

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

Answer choices
Show answer

Correct answers: C, D

A package in Python may contain an __init__.py file which is intended to initialize the package's state; however, the correct name for this file is __init__.py, not init.py. The __pycache__ folder is used to store semi-compiled (bytecode) Python modules, which are generated when the Python interpreter executes scripts for better performance. The sys.path variable is indeed a list of strings that specifies the directories the interpreter should search for modules being imported. Therefore, the correct statements are that __pycache__ is a folder that stores semi-compiled Python modules and that the sys.path variable is a list of strings.

Community votes

5 votes

CDSuggested

80%

AC

20%

Question 2 of 129

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)

Answer choices
Show answer

Correct answer: B

In the given code, 'b1 = type(dir(math)) is list' checks if the return type of 'dir(math)' is a list, which it is. Similarly, 'b2 = type(sys.path) is list' checks if 'sys.path' is a list, which is also true. Since both b1 and b2 are true, 'print(b1 and b2)' will output True.

Community votes

9 votes

BSuggested

100%

Question 3 of 129

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.)
Answer choices
Show answer

Correct answers: A, D

To invoke the function pyfun() from the module pymod inside the package pypack, there are two correct approaches. The first approach is to directly import the function using 'from pypack.pymod import pyfun', which allows you to call pyfun() directly. The second approach is to import the package and the module separately using 'import pypack' and 'import pypack.pymod', then you can call the function using 'pypack.pymod.pyfun()'.

Community votes

3 votes

ADSuggested

100%

Question 4 of 129

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()

Answer choices
Show answer

Correct answer: C

The expressions that will always evaluate to True involve understanding the behavior of the functions used. The function random.random() generates a float number between 0.0 and 1.0, so v1 and v2 will never be equal and v1 will never be greater than 1. Therefore, the expression 'v1 == v2' will always evaluate to False. Similarly, 'v1 > 1' will always evaluate to False. The function random.sample([1,2,3], 1) generates a list of one element sampled from the given list, making 'len(random.sample([1,2,3],1)) > 2' impossible as the length will always be 1. The only expression that will always be True is 'random.choice([1,2,3]) > 0' because random.choice([1,2,3]) will always choose a number from the list [1, 2, 3], all of which are greater than 0.

Community votes

2 votes

CSuggested

100%

Question 5 of 129

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

Exam PCAP-31-03: Question 5 - Image 1
Answer choices
Show answer

Correct answers: A, B

The correct forms of the directives to import module_c file considering the directory structure are: 'from pypack.upper.lower import module_c' and 'import pypack.upper.lower.module_c'. These correctly reference the full path of the module. The other options are incorrect because they either omit necessary parts of the path or do not start from the root package.

Community votes

9 votes

ABSuggested

100%

124 questions still locked

Your preview covered the first 5 questions. Unlock the rest to see every explanation and discussion thread, updated weekly

View plans

Choose your plan

Single payment · No subscription · No hidden fees

Standard

For a focused sprint before your exam date

$25USD

30 days of access, single payment

  • All 129 questions unlocked
  • Detailed answer explanations
  • Community discussions and votes
  • Weekly question updates
  • Printable PDF download
  • 100% refund if you do not pass

Premium

Extra runway, the PDF, and the refund guarantee

$35$60USD

90 days of access, single payment

Printable PDF download

Save every question as a PDF for offline study or printing.

  • All 129 questions unlocked
  • Detailed answer explanations
  • Community discussions and votes
  • Weekly question updates

Full refund if you do not pass

Send us your exam result and we refund the purchase.

Stories from the certified

Charles Sirois
Canada
As this was my first certification exam, I was understandably nervous about what to expect. These study materials made the preparation process much easier, and many of the questions closely reflected those on the actual exam.
Lance Chambers
United States
Wasted about a month going through the free dump sites scattered all over reddit, half the answers were wrong and the other half were for a version of the exam that doesn't even exist anymore. Eventually gave in and paid the small fee here, and the difference was night and day.
Alisha Kelly
Italy
Honestly, I had already gone through the official documentation quite thoroughly, but still didn't feel fully confident going in. This helped things finally click for me. I realized I knew the material, but just hadn't connected all the pieces yet.
Casper Claassen
Netherlands
Used this along with Microsoft Learn and the combo worked really well. The practice questions made the stuff I'd read actually stick. Passed first attempt, no complaints from me.
Gabriele Ghesla
Italy
The content is accurate and clearly presented, and it's more affordable than competitors. The team has been incredibly responsive whenever I've had an issue, and they've been open to small changes that improve the platform.
Charles Sirois
Canada
As this was my first certification exam, I was understandably nervous about what to expect. These study materials made the preparation process much easier, and many of the questions closely reflected those on the actual exam.
Lance Chambers
United States
Wasted about a month going through the free dump sites scattered all over reddit, half the answers were wrong and the other half were for a version of the exam that doesn't even exist anymore. Eventually gave in and paid the small fee here, and the difference was night and day.
Alisha Kelly
Italy
Honestly, I had already gone through the official documentation quite thoroughly, but still didn't feel fully confident going in. This helped things finally click for me. I realized I knew the material, but just hadn't connected all the pieces yet.
Casper Claassen
Netherlands
Used this along with Microsoft Learn and the combo worked really well. The practice questions made the stuff I'd read actually stick. Passed first attempt, no complaints from me.
Gabriele Ghesla
Italy
The content is accurate and clearly presented, and it's more affordable than competitors. The team has been incredibly responsive whenever I've had an issue, and they've been open to small changes that improve the platform.
Morgan Farmer
United Kingdom
I don't usually leave reviews, but this one felt worth sharing. The questions were quite close to what actually appeared on the exam, more than I expected. I spent about a week going through the material before my test, and it helped me feel more prepared.
Remi Nuyts
United States
Passed ITIL 4 Foundation with 87%. Material was enough by itself.
Archie Hopkins
United States
I had a smooth experience from start to finish. Access was available right away, no technical issues, which made it easy to get started. The content felt relevant and aligned well with what I was looking for.
Nancy Mcbride
United States
Does what it says it does. Content felt solid, nothing confusing to navigate and I didn't run into any weird issues. I been putting off scheduling the exam for a while and going through this gave me enough confidence to finally book it and pass.
Neil Savage
United States
A very quick response was received via email when a link issue occurred. The study materials provided were high quality and extremely helpful. I was able to complete the test successfully. Many thanks for the excellent support.
Morgan Farmer
United Kingdom
I don't usually leave reviews, but this one felt worth sharing. The questions were quite close to what actually appeared on the exam, more than I expected. I spent about a week going through the material before my test, and it helped me feel more prepared.
Remi Nuyts
United States
Passed ITIL 4 Foundation with 87%. Material was enough by itself.
Archie Hopkins
United States
I had a smooth experience from start to finish. Access was available right away, no technical issues, which made it easy to get started. The content felt relevant and aligned well with what I was looking for.
Nancy Mcbride
United States
Does what it says it does. Content felt solid, nothing confusing to navigate and I didn't run into any weird issues. I been putting off scheduling the exam for a while and going through this gave me enough confidence to finally book it and pass.
Neil Savage
United States
A very quick response was received via email when a link issue occurred. The study materials provided were high quality and extremely helpful. I was able to complete the test successfully. Many thanks for the excellent support.

Before you buy

Answers about access, updates, payments, and the refund policy.

01Are these real exam questions?

Our Python Institute PCAP-31-03 questions are based on real exam experiences and are continuously updated to match the current exam format. Most candidates who study with us report passing on their first attempt, based on a self reported post exam survey.

02What happens if I don't pass the exam?

With our Premium package, you get a 100% money back guarantee. If you don't pass your exam after studying with our materials, simply contact us with your exam results and we'll refund your purchase. Terms and conditions apply, read our full refund policy to learn more.

03How often are the questions updated?

Our question bank is updated regularly based on feedback from recent exam takers. We typically review and update our content every week with reports about new questions or changes to the exam format.

04Can I extend my access period?

Yes. When your access is close to expiring, you can renew it for another 30 days directly from the exam page. If you need more time while you are still preparing, reach out and we will help.

05Is this a single payment or a subscription?

This is a single payment with no recurring charges. Once you purchase, you get full access to all exam questions for the duration of your package (30 days for Standard, 90 days for Premium). No hidden fees or automatic renewals.

06How many questions are included?

You get access to all 129 questions in our database for the Python Institute PCAP-31-03 exam. This includes detailed explanations and answer justifications to help you understand the concepts thoroughly.

07Do you offer technical support?

Yes. Email us at hello@examice.com for help with access, billing, or the platform. We read every message and typically reply within 24 hours on business days.

08Is my payment secure?

Absolutely! We use industry standard SSL encryption and process all payments through Stripe, a trusted payment processor used by millions of businesses worldwide. Your payment and personal information are completely secure.

Ready to unlock the rest

All 129 questions from $25, single payment, instant access.

Back to plans