Free PCAP: Certified Associate in Python Programming Exam Questions and Answers
Certified Associate in Python Programming is exam PCAP, part of the Python Institute certification programme from OpenEDG's Python Institute. The Python Institute is a non-profit initiative of OpenEDG, and its ladder is real but not gatekept — PCEP, then PCAP, then PCPP1 and PCPP2, with each prerequisite recommended rather than enforced, so you may sit any of them cold. PCEP costs $69 through OpenEDG's own testing service and is offered in English, Spanish, Portuguese, Polish and Japanese. From PCAP upward the exams run through Pearson VUE at $295: PCAP is 40 questions in 65 minutes needing 70%, PCPP2 is 45 in 65 at the same threshold, and both are valid for five years. The professional papers are English only.
Looking for PCAP exam dumps or ExamTopics PCAP questions? These PCAP practice questions cover the same ground with verified answers and explanations, a downloadable PCAP PDF and a full PCAP practice test, kept current as Python Institute updates the exam.
Last updated: October 29, 2026
- Exam code
- PCAP
- Provider
- Python Institute
- Questions in our bank
- 1000+
- Free to read
- First 10, with answers
- Official page
- Official Exam website
- Our test mode duration & pass mark
- 130 mins · 70%
Recommended: Switch to Test Mode to start a practice test that simulates the real exam experience.
Question #1
What is the expected output of the following code? class Box: count = 0 def __init__(self): self.size = 1 b = Box() print(hasattr(Box, 'size'), hasattr(b, 'count'))
Correct answer: A
Explanation
The attribute size is created in __init__ and belongs only to instances, so the class Box has no such attribute. The attribute count is defined in the class, and attribute lookup on an instance falls back to the class, so hasattr(b, 'count') is True.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #2
Which of the following statements about the open() function are true? (Select two answers)
Select 2 answers.
Correct answer: C, D
Explanation
Mode 'w' truncates an existing file, while mode 'a' appends to the end. Mode 'r' raises FileNotFoundError when the file is missing instead of creating it, and read() in text mode returns a str, not bytes.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #3
What is the expected output of the following code? class AppError(Exception): pass class DbError(AppError): pass try: raise DbError('x') except ValueError: print('V', end='') except AppError: print('A', end='') except DbError: print('D', end='') finally: print('F', end='')
Correct answer: A
Explanation
DbError is a subclass of AppError, so the first matching except branch, the one for AppError, handles it. The branch for DbError is never reached because the more general class comes first. The finally block always runs afterward, so the output is AF.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #4
Which of the following values can be returned by the expression random.randrange(2, 10, 3)?
Correct answer: B
Explanation
randrange(2, 10, 3) picks from the sequence 2, 5, 8, starting at 2, stepping by 3 and excluding 10. Of the options, only 5 belongs to that sequence.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #5
Which of the following statements about the platform module are true? (Select two answers)
Select 2 answers.
Correct answer: C, D
Explanation
python_implementation() returns the interpreter name as a string, and system() returns the operating system name. The kernel or OS version comes from release() and version(), and python_version() returns a string like '3.12.1'. A tuple is returned by python_version_tuple(), and even that holds strings.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #6
What is the expected output of the following code? s = 'abcdef' print(s[::-2] + s[1:4])
Correct answer: B
Explanation
A step of -2 with default bounds starts at the last character and gives 'fdb'. The slice s[1:4] gives 'bcd', so the concatenation is 'fdbbcd'. Starting at 'e' would require an explicit start index.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #7
What is the expected output of the following code? class E1(Exception): pass class E2(E1): pass def f(n): try: if n == 0: raise E2 if n == 1: raise E1 return 'ok' except E2: return 'e2' finally: print('f', end='') for n in (0, 1, 2): try: print(f(n), end=' ') except E1: print('e1', end=' ')
Correct answer: B
Explanation
For n=0 the E2 is caught inside f, and finally prints f before the returned value is printed. For n=1 the E1 is not an E2, so it is not caught in f, but finally still prints f before the exception reaches the outer handler, which prints e1. For n=2 the function returns after finally runs, giving fok.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #8
What is the expected output of the following code? class RangeError(ValueError): def __init__(self, value): super().__init__('out of range: ' + str(value)) self.value = value try: raise RangeError(7) except ValueError as e: print(e, e.value)
Correct answer: B
Explanation
RangeError is a subclass of ValueError, so the except clause catches it. Printing the exception object shows the message passed to the base class constructor, 'out of range: 7', and e.value is the stored attribute 7.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #9
Which object-oriented concept is demonstrated when the same method call, such as shape.area(), runs different code depending on the class of the object the variable refers to?
Correct answer: A
Explanation
Polymorphism means that objects of different classes respond to the same method name with their own implementation. Encapsulation concerns hiding internal state, and composition describes building objects from other objects.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #10
What is the expected output of the following code? class Vehicle: pass class Car(Vehicle): pass c = Car() print(isinstance(c, Vehicle), issubclass(Vehicle, Car), type(c) is Vehicle)
Correct answer: D
Explanation
An instance of a subclass is also an instance of its superclass, so isinstance(c, Vehicle) is True. issubclass(Vehicle, Car) is False because the relationship runs the other way. type(c) is Car, not Vehicle, so the identity test is False.
Continue with PCAP: Certified Associate in Python Programming
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in PCAP: Certified Associate in Python Programming, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Discussion
Explain your reasoning, not just the letterOther Python Institute certifications
Reviews
Write a review★★★★★
Exam Practice is worth every penny. The mock exams are realistic, and the feedback helped me focus on key areas.
Amit SharmaVerified buyer
★★★★★
I highly recommend Exam Practice. The feedback after each test helped me improve significantly, and I passed my exams easily.
Oscar NyströmVerified buyer
★★★★★
This platform is a lifesaver. The practice questions and explanations are so detailed. It’s the best study tool I’ve ever used.
Hannah SmithVerified buyer
FAQ
Learn More: https://pythoninstitute.org/certification-tracks
- Q1: What is the PCAP: Certified Associate in Python Programming exam?
- A: PCAP: Certified Associate in Python Programming is a Python Institute certification exam. Judging by the questions in our bank, it concentrates on python and variable.
- Q2: How should I prepare for PCAP: Certified Associate in Python Programming?
- A: Work through the PCAP: Certified Associate in Python Programming practice questions here, checking your answer on each one, then sit the practice test to rehearse the exam under timed conditions before the real thing.
- Q3: Are these real PCAP: Certified Associate in Python Programming exam questions?
- A: They are drawn from officially released past questions and from community members who have sat PCAP: Certified Associate in Python Programming. Answers are verified and updated weekly.
- Q4: Where do I register for the PCAP: Certified Associate in Python Programming exam?
- A: Register through Python Institute directly at https://pythoninstitute.org/certification-tracks. Exampractice is not affiliated with Python Institute and does not administer the exam.
- Q5: Is there a free PCAP: Certified Associate in Python Programming sample?
- A: Yes. Every PCAP: Certified Associate in Python Programming page shows a free sample of real questions. Upgrading opens the full bank and the practice test.
- Q6: What are Python Institute Certification Exams?
- A: Python Institute Certification Exams validate your expertise in using and programming with Python. These certifications demonstrate your proficiency in Python programming, from fundamental concepts to advanced skills, ensuring you can effectively develop and implement Python-based solutions.
- Q7: Why should I pursue Python Institute Certification?
- A: Python Institute Certification enhances your professional credibility, showcasing your skills and knowledge in Python programming. This can lead to better job opportunities, higher salaries, and career advancement in software development, data science, web development, and related fields.
- Q8: What are the benefits of Python Institute Certification?
- A: Benefits include recognition as a certified Python programmer, improved job performance, access to exclusive resources, continuing education opportunities, and staying current with the latest Python programming practices and industry standards.
- Q9: Who should take Python Institute Certification Exams?
- A: Aspiring programmers, software developers, data scientists, web developers, and anyone involved in programming and developing applications using Python should consider these certifications to validate their expertise and advance their careers.
- Q10: What types of Python Institute Certification Exams are available?
- A: Python Institute offers various certification paths, including:
- Q11: How do I prepare for Python Institute Certification Exams?
- A: Preparation can include official Python Institute training courses, study guides, practice exams, online tutorials, and hands-on experience in Python programming.
- Q12: Where can I take Python Institute Certification Exams?
- A: Python Institute Certification Exams can be taken online with remote proctoring or at authorized Pearson VUE testing centers worldwide, providing flexibility to fit your schedule and location.
- Q13: How do Python Institute Certifications impact my career?
- A: Python Institute Certifications significantly boost your career by demonstrating your expertise to employers, making you a more competitive candidate for advanced roles and promotions in software development, data science, web development, and related fields.
- Q14: Are there any prerequisites for Python Institute Certification Exams?
- A: The PCEP exam has no prerequisites. However, for the PCAP and PCPP exams, it is recommended to have foundational knowledge and prior experience in Python programming. Check the specific requirements for each certification path on the Python Institute website.
- Q15: How often do I need to recertify for Python Institute Certifications?
- A: Python Institute certifications do not require mandatory recertification. However, staying updated with the latest Python programming practices and continuing professional development is recommended to maintain your skills and relevance in the industry.



