
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 2
PCAP-31-03 4.2 Employ Class and Object Properties PCAP-31 Practice Questions (Page 3)
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
8concepts
34%of the exam
Questions 11–15
- 11
A developer defines `class A: def __init__(self): self.__x = 1` and `class B(A): def __init__(self): super().__init__(); self.__x = 2`. After `b = B()`, what keys exist in `b.__dict__`?
Select an answer first - 12
A class `Database` defines `__connection = None` as a class variable. A subclass `MySQLDatabase(Database)` attempts to access `self.__connection` inside its own method. What happens?
Select an answer first - 13
A developer inspects an object's `__dict__` and sees the key `_BankAccount__pin`. What does this indicate about the original attribute definition?
Select an answer first - 14
A developer needs to serialize an object's state for debugging. The object has both public instance variables and private ones (defined with double underscores). Which approach reliably captures all instance-level data?
Select an answer first - 15
What is the key characteristic of a class variable?
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.