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

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.)

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option 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.

Select the true statements about PEP 8 recommendations related to using blank lines. (Select two answers.)

A.

You should not put any blank lines between groups of imports.

B.

You should surround top-level functions and class definitions with one blank line.

C.

You should surround top-level functions and class definitions with two blank lines.

D.

You should surround method definitions inside classes by a single blank line.

Select the true statements related to PEP 8 naming conventions. (Select two answers.)

A.

Function and variable names should be lower-case with words separated by underscores.

B.

You should always use self as the first argument to instance methods, and cls as the first argument to class methods.

C.

Modules should have short names written in CameICase.

D.

Constants should be written in all lower-case letters with words separated by underscores

Select the true statements related to PEP 8 naming conventions. (Select two answers.)

A.

Class names should use the mixedCase naming style.

B.

Exception names should follow the function naming conventions.

C.

Modules should have short names entirely in lower-case.

D.

You should never use the characters “l” (lower-case letter “el”) and “O” (upper-case letter “oh”) as single character variable names.

What is a static method?

A.

A method that works on the class itself

B.

A method decorated with the @method trait

C.

A method that requires no parameters referring to the class itself

D.

A method that works on class objects that are instantiated

Select the true statements about the following invocation:

(Select two answers.)

A.

It addresses a service deployed at localhost (the host where the code is run).

B.

It addresses a service whose timeout is set to 3000 ms.

C.

It addresses a service located at the following address local.host.com.

D.

It addresses a service listening at port 3000.

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 isinstanceO function

C.

The id () function

D.

The is operator

What is wrong with the following snippet?

class A:

def run(self):

print("A is running")

class B(A):

def run(self):

print("B is running")

class C(A, B):

def fly(self):

print("C is flying")

c = C()

A.

There is no run() method defined for the C class.

B.

It causes MRO inconsistency.

C.

Nothing. The code is fine.

D.

There are no __init__() methods — each class should implement this method.

Which of the following types cannot be pickled?

A.

integers, floating-point numbers, complex numbers

B.

function and class definitions

C.

None, booleans

D.

strings, bytes, bytearrays