Spring 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: 5 / 5
Total 154 questions

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

A.

a ( ) == 4

B.

a is not None

C.

b ( ) == 4

D.

a ! = b

Assuming that String is six or more letters long, the following slice

String[1:-2]

is shorter than the original string by:

A.

four chars

B.

three chars

C.

one char

D.

two chars

Executing the following snippet

will cause the dct:

A.

to hold two keys named ‘pi’ linked to 3.14 and 3.1415 respectively

B.

to hold two key named ‘pi’ linked to 3.14 and 3.1415

C.

to hold one key named ‘pi’ linked to 3.1415

D.

to hold two keys named ‘pi’ linked to 3.1415

Which of the following lines of code will work flawlessly when put independently inside the add_new () method in order to make the snippet's output equal to [0, 1, 21 ? (Select two answers)

A.

self.queue.append(get_Iast() + 1)

B.

queue.append(self.get last () + 1)

C.

self.queue.append(self.queue[+1]

D.

self.queue.append(self.get last() +1)

What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?

A.

0

B.

-1

C.

an errno value corresponding to file not found

D.

2

What is the expected behavior of the following code?

A.

it outputs list assignment index out of range

B.

the code is erroneous and it will not execute

C.

it outputs

D.

it outputs error