
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 5
PCAP-31-03 4.5 Build a Class Hierarchy Using Inheritance PCAP-31 Practice Questions (Page 2)
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 24 practice questions to prepare you well beyond it. (estimate)
24questions here
5free pages
8concepts
34%of the exam
Questions 6–10
- 6
A developer defines `class Shape: def area(self): return 0` and `class Rectangle(Shape): def __init__(self, w, h): self.w = w; self.h = h; def area(self): return self.w * self.h`. What does `Rectangle(3, 4).area()` return?
Select an answer first - 7
A developer has `class Vehicle: pass` and `class Car(Vehicle): pass`. They create `c = Car()`. Which expression evaluates to `True`?
Select an answer first - 8
A developer defines `class A: def m(self): return "A"`, `class B(A): pass`, `class C(A): def m(self): return "C"`, and `class D(B, C): pass`. What does `D().m()` return?
Select an answer first - 9
In the diamond problem, what is the main issue that arises in multiple inheritance?
Select an answer first - 10
Given the following code: class Book: def __init__(self, title): self.title = title def __str__(self): return self.title b = Book("Python Basics") print(str(b)) What is the output?
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.