
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 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 24 practice questions to prepare you well beyond it. (estimate)
24questions here
5free pages
8concepts
34%of the exam
Questions 1–5
- 1
Consider the following code: class Cat: def sound(self): return "Meow" class Dog: def sound(self): return "Woof" def make_sound(animal): return animal.sound() print(make_sound(Cat())) print(make_sound(Dog())) What does this code demonstrate?
Select an answer first - 2
Consider the following class definitions: class A: def greet(self): return "A" class B: def greet(self): return "B" class C(A, B): pass c = C() print(c.greet()) What is the output?
Select an answer first - 3
Given the following code: class Vehicle: def move(self): return "Moving" class Car(Vehicle): pass car = Car() print(car.move()) What is the output?
Select an answer first - 4
A developer defines `class Animal: def speak(self): return "Generic sound"` and `class Dog(Animal): def speak(self): return "Woof"`. They call `Dog().speak()`. What is the result?
Select an answer first - 5
Consider the following code: class Parent: def show(self): return "Parent" class Child(Parent): def show(self): return "Child" c = Child() print(c.show()) 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.