Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCAP - Certified Associate Python Programmer

Domain 4Objective 4

PCAP-31-03 4.4 Discover the Class Structure PCAP-31 Practice Questions (Page 1)

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 21 practice questions to prepare you well beyond it. (estimate)

21questions here
5free pages
6concepts
34%of the exam

Questions 1–5

  1. 1application · medium

    A framework needs to determine if a class directly inherits from a specific base class, not through an intermediate class. Which property should be inspected?

    Select an answer first
  2. 2application · medium

    A developer is writing a generic validation function that receives an object and needs to check if it has a 'validate' method. The function should work for any object, including those where 'validate' might be defined on the class. Which code correctly performs this check?

    Select an answer first
  3. 3application · medium

    A debugging tool needs to display both the class name and the module name of an object for logging purposes. Which expression correctly retrieves both pieces of information?

    Select an answer first
  4. 4application · easy

    A developer is creating a factory function that returns a new instance of a class. The function needs to log the class name of the created object. Which expression correctly retrieves this information?

    Select an answer first
  5. 5foundation · easy

    Given the code below, what is the output? class MyClass: class_attr = 10 def __init__(self): self.instance_attr = 20 obj = MyClass() print(hasattr(obj, 'class_attr'), hasattr(obj, 'instance_attr'))

    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.