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

Python Institute PCAP-31-03 - Certified Associate in Python Programming

Page: 1 / 5
Total 154 questions

Assuming that the code below has been placed inside a file named code.py and executed successfully which of the following expressions evaluate to True? (Select two answers)

A.

str (Object) = 'Object1

B.

Class A.__module__ == ' main__'

C.

len (ClassB.__bases__) == 2

D.

__name__== '__main__'

A method for passing the arguments used by the following snippet is called:

A.

sequential

B.

named

C.

positional

D.

keyword

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

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

What is true about the __based__attribute in Python?

A.

It is accessible inside a class and an object.

B.

There is no such property.

C.

it is accessible inside an object

D.

It is accessible inside a class

Which of the following expressions evaluate to True?

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

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

A.

obj_b.prop_a == 3

B.

hasattr(obj_b, 'prop_aa')

C.

isinstance(obj_c,A)

D.

B. VarA == 3

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

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

Python's built-in function named open () tries to open a file and returns:

A.

an integer value identifying an opened file

B.

an error code (0 means success)

C.

a stream object

D.

always None

Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Select two answers)

Expected output:

1 2 3

Code:

A.

c, b, a = b, a, c

B.

c, b, a = a, c, b

C.

a, b, c = c, a, b

D.

a, b, c = a, b, c

What is the expected output of the following snippet?

A.

1

B.

4

C.

2

D.

3