Python Institute PCPP-32-101 - Certified Professional in Python Programming 1 Exam
Page: 2 / 16
Total 80 questions
Question #6 (Topic: Exam A)
Analyze the following snippet and select the statement that best describes it.

A. The code is syntactically correct despite the fact that the names of the function parameters do not follow the naming convention
B. The *arg parameter holds a list of unnamed parameters.
C. The code is missing a placeholder for unnamed parameters.
D. The code is syntactically incorrect - the function should be defined as def f1 (*args, **kwargs):
Answer: A
Question #7 (Topic: Exam A)
Analyze the following snippet and decide whether the code is correct and/or which method should be distinguished as a class method.

A. There is only one initializer, so there is no need for a class method
B. The getNumberOfCrosswords() method Should be decorated with @classmethod
C. The code is erroneous
D. The getNumberOfCrosswords() and isSolved methods should be decorated with @classmethod
Answer: B
Question #8 (Topic: Exam A)
Analyze the code and choose the best statement that describes it.

A. __ne__() is not a built-in special method.
B. The code is erroneous
C. The code is responsible for the support of the negation operator, e.g. a = - a
D. The code is responsible for the support of the inequality operator, i.e. !=
Answer: D
Question #9 (Topic: Exam A)
Which function or operator should you use to obtain the answer True or False to the question "Do two variables refer to the same object?"
A. The == operator
B. The isinstance() function
C. The id() function
D. The is function
Answer: D
Question #10 (Topic: Exam A)
Which sentence about the @property decorator is false?
A. The @property decorator should be defined after the method that is responsible for setting an encapsulated attribute.
B. The @property decorator designates a method which is responsible for returning an attribute value.
C. The @property decorator marks the method whose name will be used as the name of the instance attribute.
D. The @property decorator should be defined before the methods that are responsible for setting and deleting an encapsulated attribute.
Answer: A