
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 2)
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 6–10
- 6
Given the following code, what is the output? def greet(): pass print(greet.__name__)
Select an answer first - 7
A developer is building a framework that must automatically add a `__repr__` method to every class that does not define one. The generated `__repr__` should return a string with the class name and the values of all instance attributes. Which approach should be used?
Select an answer first - 8
A developer is writing a script that needs to create a class with a method that returns a constant value. The class name and the constant value are read from a configuration file. Which approach should be used?
Select an answer first - 9
What is the correct way to define a custom metaclass in Python?
Select an answer first - 10
In a metaclass's __new__ method, how can you add a new class variable to the class being created?
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. “PCPP-32-1” is a trademark of its owner, used for identification only.