Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCAP - Certified Associate Python Programmer

Domain 4Objective 1

PCAP-31-03 4.1 Understand the Object-Oriented Approach PCAP-31 Practice Questions (Page 8)

Part of the Object-Oriented Programming domain, which accounts for 34% of the PCAP-31 exam. Python Institute does not publish an official question count, but from its 65-minute exam (~25–45 total, ~9–15 in this domain), expect 2–3 from this objective — we provide 51 practice questions to prepare you well beyond it. (estimate)

51questions here
11free pages
7concepts
34%of the exam

Questions 36–40

  1. 36expert · hard

    A developer is designing a class to store sensitive data. They want to prevent accidental modification of the __data attribute from outside the class. They also want to provide a getter method. Which approach best achieves encapsulation while allowing controlled access?

    Select an answer first
  2. 37expert · hard

    A team is building a class hierarchy for a zoo. They have a base class Animal with an __init__ that sets self.name. They need a subclass Bird that adds self.wingspan. They also want to ensure that when a Bird is created, the Animal __init__ is called. Which code correctly implements this?

    Select an answer first
  3. 38expert · hard

    A developer is troubleshooting why an attribute is not accessible from outside a class. The attribute is defined as self.__secret. What is the correct way to access it from outside the class?

    Select an answer first
  4. 39expert · hard

    A class Base has a method greet() that prints 'Hello from Base'. A class Derived inherits from Base and overrides greet() to print 'Hello from Derived'. The developer wants to call the Base version of greet() from within Derived's greet(). Which code correctly does this?

    Select an answer first
  5. 40expert · hard · select all that apply

    Given the following class definitions, which statements are true? class A: def __init__(self): self.x = 1; def method_a(self): pass; class B(A): def __init__(self): super().__init__(); self.y = 2; def method_b(self): pass; class C(B): pass

    Select an answer first
Finished these 5 questions?

Review the revealed explanations, or continue through the curriculum.

Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by Python Institute. “PCAP-31” is a trademark of its owner, used for identification only.