
Python InstitutePCAP - Certified Associate Python Programmer
Domain 4Objective 6
PCAP-31-03 4.6 Construct and Initialize Objects PCAP-31 Practice Questions (Page 9)
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 48 practice questions to prepare you well beyond it. (estimate)
48questions here
10free pages
5concepts
34%of the exam
Questions 41–45
- 41
A developer is creating a `Vector` class. They want the constructor to accept either two numbers (x, y) or a single tuple containing two numbers. Which constructor implementation handles both cases?
Select an answer first - 42
In a `BankAccount` class, the constructor is `def __init__(self, owner, balance=0):`. Inside the constructor, which line correctly sets the `owner` attribute on the newly created instance?
Select an answer first - 43
A team defines a simple `Point` class with no `__init__` method. They then write `p = Point()`. What happens?
Select an answer first - 44
A car rental system needs a `Car` class where each car is created with a license plate and a daily rate. The constructor should allow creating a car with `Car('ABC-123', 45)`. Which constructor signature is correct?
Select an answer first - 45
A developer is writing a `Book` class and wants to ensure that every book object has a `title` and an `author` attribute. Which code snippet correctly declares the constructor?
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.