Summer Sale Special - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sntaclus

Which of the following examples using line breaks and different indentation methods are compliant with PEP 8 recommendations? (Select two answers.)

A.

my_dict = {

"X": "180.A",

"Y": "206.P",

"Z": "12.C"

}

B.

spam = my_function(arg_one,

arg_two,

arg_three,

arg_four)

C.

foo = my_function

(arg_one, arg_two,

arg_three, arg_four

)

D.

my_dict = { "A" : "1", "B" : "2", "C" : "1" }

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

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

A.

self. name is the name of a class variable.

B.

varl 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

What will be the content of the co/ors.csv file when you run the following code?

A)

B)

C)

D)

An exception will be raised.

A.

Option A

B.

Option B

C.

Option C

D.

Option D

What is ElementTree?

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.

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.

Which of the following values can be returned by the messagebox. askquestion () method?

A.

"accept:" and "cancel''

B.

l and o

C.

"yes" and "no"

D.

True and False

Select the true statements related to PEP 8 programming recommendations for exception handling. (Select two answers.)

A.

When designing exception hierarchies, you should focus on stating that a problem occurred, rather than programmatically trying to answer the question about what actually went wrong.

B.

You should generally use “bare” except: clauses, as they will not catch SystemExit and KeyboardInterrupt exceptions, making it more difficult to interrupt a program using keyboard shortcuts.

C.

You should derive exceptions from the Exception class, rather than from the BaseException class.

D.

You should generally limit the use of a “bare” except: clause and, whenever possible, use specific exceptions instead.

Select the true statement about the___name___attribute.

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.

Which of the following is not a widget property?

A.

width

B.

underline

C.

highlightthickness

D.

depth