Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCAP - Certified Associate Python Programmer

Domain 4Objective 6

PCAP-31-03 4.6 Construct and Initialize Objects PCAP-31 Practice Questions (Page 6)

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 26–30

  1. 26application · medium

    A developer is implementing a class to represent a car. The __init__ method should set the make and model as instance attributes. Which code snippet correctly binds these attributes to the instance?

    Select an answer first
  2. 27application · medium

    A developer defines a class called Logger with no __init__ method. They then attempt to create an instance with logger = Logger('debug'). What happens?

    Select an answer first
  3. 28application · medium

    A developer needs to define a class named Book where each book object must have a title and an author, both provided at the time of creation. Which constructor declaration is correct?

    Select an answer first
  4. 29application · medium

    A logistics company needs a `Shipment` class where each shipment object is created with a tracking number and a destination city. The tracking number must be stored as an instance attribute. Which class definition correctly initializes these attributes when a shipment is created with `Shipment('TRK123', 'Berlin')`?

    Select an answer first
  5. 30application · medium

    A configuration class `AppConfig` is designed to be initialized with a `host` and a `port`. The constructor is `def __init__(self, host, port=8080):`. Which call correctly creates a config with host `'localhost'` and port `9090`?

    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.