
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 4
PCAP-31-03 4.4 Discover the Class Structure 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
6concepts
34%of the exam
Questions 11–15
- 11
If a class is defined in a file named 'shapes.py' and imported into another script, what does the __module__ property of that class return?
Select an answer first - 12
Given the code below, what is the output? class Base: def greet(self): return 'Hello' class Derived(Base): pass print(hasattr(Derived, 'greet'))
Select an answer first - 13
Given the code below, what is the output? class A: pass class B(A): pass class C(B): pass print(C.__bases__)
Select an answer first - 14
A developer is analyzing a class hierarchy and needs to know if a class directly inherits from a specific base class, not through an intermediate. They have the class object and the base class object. Which check correctly determines this?
Select an answer first - 15
A logging utility needs to record the class name of an object being processed. The object could be an instance of any class. Which expression correctly retrieves the class name as a string?
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.