Pass the Python Institute PCAP PCAP-31-03 Questions and answers with CertsForce

Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
Questions # 41:

Select the valid fun () invocations:

(select two answers)

def fun (a, b=0):

return a*b

Options:

A.

fun(b=1)


B.

fun (a=0)


C.

fun(b=1, 0)


D.

fun (1)


Expert Solution
Questions # 42:

A variable stored separately in every object is called:

Options:

A.

there are no such variables, all variables are shared among objects


B.

a class variable


C.

an object variable


D.

an instance variable


Expert Solution
Questions # 43:

What is true about Python packages? (Select two answers)

Options:

A.

the__name__variable content determines the way in which the module was run


B.

a package can be stored as a tree of sub-directories/sub-folders


C.

__pycache__is the name of a built-in variable


D.

hashbang is the name of a built-in Python function


Expert Solution
Questions # 44:

What is the expected output of the following code?

Question # 44

Options:

A.

4


B.

16


C.

an exception is raised


D.

1


Expert Solution
Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions