Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
Python Institute logo

Python InstitutePCPP1 - Certified Professional Python Programmer 1

Domain 1Objective 12

PCPP-32-101 1.12 Explain the Concept of Metaprogramming PCPP-32-1 Practice Questions (Page 5)

Part of the Advanced Object-Oriented Programming domain, which accounts for 35% of the PCPP-32-1 exam. Python Institute does not publish an official question count, but from its 65-minute exam (~25–45 total, ~9–16 in this domain), expect 1–1 from this objective — we provide 25 practice questions to prepare you well beyond it. (estimate)

25questions here
5free pages
9concepts
35%of the exam

Questions 21–25

  1. 21application · easy

    A developer is writing a logging utility that needs to record the type of an exception. The utility receives an exception instance and must log the class name of the exception. Which code snippet correctly retrieves the exception's class name?

    Select an answer first
  2. 22application · medium

    A developer needs to create a series of simple data-holder classes at runtime based on a configuration file. Each class should have a name derived from a string in the config, and each should contain only a set of predefined attributes with default values. The developer wants to avoid writing repetitive class definitions in source code. Which approach is most appropriate?

    Select an answer first
  3. 23application · easy

    A developer is writing a debugging tool that prints the name of the class and the names of its methods. The tool receives a class object. Which code snippet correctly prints the class name?

    Select an answer first
  4. 24application · easy

    A developer is writing a debugging utility that prints the name of the class that an object belongs to. The utility receives an arbitrary object and must display the class name in a log message. Which code snippet correctly retrieves the class name?

    Select an answer first
  5. 25foundation · easy

    Given the following code, what is the output? class MyClass: x = 10 def method(self): pass print('x' in MyClass.__dict__)

    Select an answer first
Finished these 5 questions?

Review the revealed explanations, or continue through the curriculum.

No more pagesBack to PCPP-32-1

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. “PCPP-32-1” is a trademark of its owner, used for identification only.