
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 2
PCAP-31-03 4.2 Employ Class and Object Properties 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
8concepts
34%of the exam
Questions 1–5
- 1
A class `Config` defines a class variable `__api_key = 'abc123'`. A developer tries to access it from outside the class as `Config.__api_key`. What is the result?
Select an answer first - 2
A developer writes: `class Counter: count = 0; def __init__(self): self.count = 5`. After creating `c = Counter()`, what is the value of `c.count` and `Counter.count`?
Select an answer first - 3
Where should a class variable be declared in a class definition?
Select an answer first - 4
Given the class below, what will be the output of the code? class Dog: species = 'Canis familiaris' def bark(self): return 'Woof' print(Dog.__dict__.keys())
Select an answer first - 5
A developer is debugging a class and wants to see exactly which instance variables exist on a particular object, excluding class-level attributes. Which expression returns a dictionary containing only the instance variables and their current values?
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.