Summer Sale Limited Time 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple75

Pass the Python Institute PCPP1 PCPP-32-101 Questions and answers with Dumpstech

Exam PCPP-32-101 Premium Access

View all detail and faqs for the PCPP-32-101 exam

Practice at least 50% of the questions to maximize your chances of passing.
Viewing page 3 out of 3 pages
Viewing questions 21-30 out of questions
Questions # 21:

Look at the following code snippets and decide which ones follow PEP 8 recommendations for whitespaces in expressions and statements (Select two answers.)

A)

No whitespace immediately before the opening parenthesis that starts the list of arguments of a function call:

Question # 21

B)

A whitespace immediately before a comma, semicolon, and colon:

Question # 21

C)

No whitespace between a trailing comma and a following closing parenthesis:

Question # 21

D)

A whitespace immediately after the opening parenthesis that starts indexing or slicing:

Question # 21

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Questions # 22:

Select the true statement about the socket. gaierror exception.

Options:

A.

It is raised when a timeout occurs on a socket.

B.

It is raised when a system function returns a system-related error.

C.

It is raised when an address-related error caused by the repr () function occurs.

D.

It is raised when an address-related error caused by the getaddrinfo () and getnameinfo () functions occurs.

Questions # 23:

Look at the following examples of comments and docstrings in Python. Select the ones that are useful and compliant with PEP 8 recommendations. (Select the two best answers.)

Options:

A.

def net_expense(q, price):

"""Return the total cost of items before tax."""

return q * price

B.

n = n - 1 # Decrement n by 1.

C.

val = val + 1.15 # Compensate for diminished value.

D.

def total_cost(q):

'''Takes the q argument and multiplies it by 1.15.'''

return q * 1.15

Questions # 24:

Which of the following methods allow you to load a configuration using ConfigParser? (Select two answers.)

Options:

A.

read

B.

read_dict

C.

read_conf

D.

read_str

Questions # 25:

What is true about type in the object-oriented programming sense?

Options:

A.

It is the bottommost type that any object can inherit from.

B.

It is a built-in method that allows enumeration of composite objects

C.

It is the topmost type that any class can inherit from

D.

It is an object used to instantiate a class

Questions # 26:

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

Question # 26

Options:

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.

Questions # 27:

Analyze the following snippet and decide whether the code is correct and/or which method should be distinguished as a class method.

Question # 27

Options:

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 gexNumberOfcrosswords () and issrived methods should be decorated with @classzoechod.

Questions # 28:

What is ElementTree?

Options:

A.

A Python built-in module that contains functions used for creating HTML files.

B.

A Python library that contains an API used for parsing and manipulating JSON files.

C.

A Python library that contains functions and tools used for manipulating text files in GUI Programming.

D.

A Python built-in module that contains functions used for parsing and creating XML data.

Questions # 29:

A socket object is usually created by which one of the following invocations?

Options:

A.

socket. socket (socket_domain, socket_type)

B.

socket = socket. socket (socket_number)

C.

socket = socket. socket (socket_domain, socket_type, server_address)

D.

socket = socket.socket(server address)

Questions # 30:

Which sentence about the ©property decorator is false?

Options:

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

Viewing page 3 out of 3 pages
Viewing questions 21-30 out of questions