Certified Associate in Python Programming (PCAP-31-03) — Question 33
What is true about Object-Oriented Programming in Python? (Choose two.)
Answer options
- A. encapsulation allows you to hide a whole class inside a package
- B. a class is a recipe for an object
- C. each object of the same class can have a different set of properties
- D. the arrows on a class diagram are always directed from a superclass towards its subclass
Correct answer: B, C
Explanation
Option B is correct because a class indeed acts as a blueprint for creating objects. Option C is also correct as different instances of the same class can have distinct properties. Option A is incorrect because encapsulation does not involve hiding entire classes but rather restricting access to specific class members. Option D is wrong because, while superclass to subclass direction is common, class diagrams can represent other relationships as well.