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

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

Files with the suffix .pyc contain:

Options:

A.

Python 4 source code


B.

backups


C.

temporary data


D.

semi-compiled Python code


Expert Solution
Questions # 2:

Assuming that the code below has been executed successfully, which of the following expressions evaluate to True? (Select two answers)

Question # 2

Options:

A.

'var' in Object.__dict__


B.

'prop' in Class.__dict


C.

len(Object.__diet__) == 1


D.

'var1 in Class, dict


Expert Solution
Questions # 3:

An operator able to perform bitwise shifts is coded as (select two answers)

Options:

A.

- -


B.

++


C.

<<


D.

>>


Expert Solution
Questions # 4:

What is true about Object-Oriented Programming in Python? (Select two answers)

Options:

A.

if a real-life object can be described with a set of adjectives, they may reflect a Python object method


B.

the same class can be used many times to build a number of objects


C.

each object of the same class can have a different set of methods


D.

a subclass is usually more specialized than its superclass


Expert Solution
Questions # 5:

Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Select two answers)

Question # 5

Options:

A.

class Class_4 (D, A) : pass


B.

class Class_1(C,D): pass


C.

class Class_3(A,C): pass


D.

class Class_2(B,D): pass


Expert Solution
Questions # 6:

What is a true about python class constructors? (Select two answers)

Options:

A.

the constructor must have at least one parameter


B.

the constructor must return a value other than None


C.

the constructor is a method named_init_


D.

there can the more than one constructor in a Python class.


Expert Solution
Questions # 7:

Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers)

Question # 7

Options:

A.

a is b


B.

b( ) > 2


C.

a() > 2


D.

a is not None


Expert Solution
Questions # 8:

A compiler is a program designed to (select two answers)

Options:

A.

rearrange the source code to make it clearer


B.

check the source code in order to see if its correct


C.

execute the source code


D.

translate the source code into machine code


Expert Solution
Questions # 9:

What is the expected behavior of the following code?

Question # 9

Options:

A.

it outputs 2


B.

the code is erroneous and it will not execute


C.

it outputs 3


D.

it outputs :


Expert Solution
Questions # 10:

What is the expected behavior of the following code?

Question # 10

It will:

Options:

A.

print 0


B.

cause a runtime exception


C.

prints 3


D.

print an empty line


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