
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 4)
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 16–20
- 16
A developer is writing a tool that needs to list all class-level attributes (not methods) of a given class. The tool should only show attributes that are defined directly on the class, not inherited ones. Which approach correctly achieves this?
Select an answer first - 17
What does the __class__ attribute of an object return?
Select an answer first - 18
A developer is working on a framework that needs to inspect the inheritance hierarchy of classes at runtime. The framework must determine the direct parent of a given class to understand its immediate lineage. Which attribute should be used?
Select an answer first - 19
A developer is building a framework that must automatically convert all class variable names to uppercase. For example, a class variable `name` should become `NAME`. The conversion should happen at class definition time. Which approach should be used?
Select an answer first - 20
Given the following metaclass, what is the value of MyClass.x? class Meta(type): def __new__(cls, name, bases, attrs): attrs['x'] = 100 return super().__new__(cls, name, bases, attrs) class MyClass(metaclass=Meta): pass print(MyClass.x)
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.