Python Institute PCPP-32-101 - Certified Professional in Python Programming 1 Exam

Page:    1 / 9   
Total 45 questions

Select the true statement about composition.

  • A. Composition extends a class’s capabilities by adding new components and modifying the existing ones
  • B. Composition allows a class to be projected as a container of different classes
  • C. Composition is a concept that promotes code reusability, while Inheritance promotes encapsulation
  • D. Composition is based on the has a relation, so it cannot be used together with inheritance


Answer : B

Analyze the following snippet and select the statement that best describes it.

  • A. The code is an example of implicitly chained exceptions.
  • B. The code is erroneous as the OwnMath class does not inherit from any Exception type class
  • C. The code is fine and the script execution is not interrupted by any exception.
  • D. The code is an example of explicitly chained exceptions


Answer : A

Analyze the following snippet and select the statement that best describes it.

  • A. self.name is the name of a class variable
  • B. var1 is the name of a global variable
  • C. Excalibur is the value passed to an instance variable
  • D. weapon is the value passed to an instance variable


Answer : C

The following snippet represents one of the OOP pillars. Which one is that?

  • A. Serialization
  • B. Inheritance
  • C. Encapsulation
  • D. Polymorphism


Answer : D

Analyze the following function and choose the statement that best describes it.

  • A. It is an example of a decorator that accepts its own arguments.
  • B. It is an example of decorator stacking.
  • C. It is an example of a decorator that can trigger an infinite recursion
  • D. The function is erroneous.


Answer : A

Page:    1 / 9   
Total 45 questions