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

Viewing page 1 out of 2 pages
Viewing questions 1-10 out of questions
Questions # 1:

If w is a correctly created main application window, which method would you use to foe both of the main window's dimensions?

Options:

A.

w. f ixshape ()


B.

w. f ixdim ()


C.

w. resizable ()


D.

w.makewindow ()


Expert Solution
Questions # 2:

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


Expert Solution
Questions # 3:

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.


Expert Solution
Questions # 4:

Select the true statements about the sqlite3 module. (Select two answers.)

Options:

A.

The fetchalt method returns None when no rows are available


B.

The execute method allows you to perform several queries at once


C.

The execute method is provided by the Cursor class


D.

The fetchone method returns None when no rows are available


Expert Solution
Questions # 5:

Select the true statement about composition

Options:

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.


Expert Solution
Questions # 6:

Select the true statement about the___name___attribute.

Options:

A.

___name___is a special attribute, which is inherent for both classes and instances, and it contains information about the class to

which a class instance belongs.


B.

___name is a special attribute, which is inherent for both classes and instances, and it contains a dictionary of object attributes.


C.

__name___is a special attribute, which is inherent for classes and it contains information about the class to which a class instance

belongs.


D.

__name___is a special attribute, which is inherent for classes, and it contains the name of a class.


Expert Solution
Questions # 7:

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

A)

Question # 7

B)

Question # 7

C)

Question # 7

D)

Question # 7

Options:

A.

OptionA


B.

OptionB


C.

OptionC


D.

OptionD


Expert Solution
Questions # 8:

Which one of the following methods allows you to debug an XML tree in the xml.etree ELementTree module?

Options:

A.

debug


B.

dump


C.

log


D.

parse


Expert Solution
Questions # 9:

Look at the following code snippets and decide which ones follow PEP 8 recommendations for whitespacesin 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 # 9

B)

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

Question # 9

C)

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

Question # 9

D)

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

Question # 9

Options:

A.

Option A


B.

Option B


C.

Option C


D.

Option D


Expert Solution
Questions # 10:

Analyze the code and choose the best statement that describes it.

Question # 10

Options:

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. i =


Expert Solution
Viewing page 1 out of 2 pages
Viewing questions 1-10 out of questions