Labour Day Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exams65

Certified Associate in Python Programming Question and Answers

Certified Associate in Python Programming

Last Update May 3, 2024
Total Questions : 145

We are offering FREE PCAP-31-03 Python Institute exam questions. All you do is to just go and sign up. Give your details, prepare PCAP-31-03 free exam questions and then go for complete pool of Certified Associate in Python Programming test questions that will help you more.

PCAP-31-03 pdf

PCAP-31-03 PDF

$35  $99.99
PCAP-31-03 Engine

PCAP-31-03 Testing Engine

$42  $119.99
PCAP-31-03 PDF + Engine

PCAP-31-03 PDF + Testing Engine

$56  $159.99
Questions 1

What is the expected output of the following snippet?

Options:

A.  

1

B.  

4

C.  

2

D.  

3

Discussion 0
Questions 2

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

Options:

A.  

a is not None

B.  

a ! =b

C.  

b () ==4

D.  

a () == 4

Discussion 0
Questions 3

What is the expected output of the following code?

Options:

A.  

a

B.  

an exception is raised

C.  

b

D.  

c

Discussion 0
Questions 4

If you need a function that does nothing, what would you use instead of XXX? (Select two answers)

def idler ( ):

XXX

Options:

A.  

pass

B.  

return

C.  

exit

D.  

None

Discussion 0
Questions 5

What is the expected behavior of the following code?

Options:

A.  

it outputs error

B.  

it outputs list assignment index out of range

C.  

the code is erroneous and it will not execute

D.  

it outputs

Discussion 0
Questions 6

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, 1] ? (Select two answers)

Options:

A.  

put self.store(1])

B.  

self put stire(1])

C.  

self .put self.get () [-1])

D.  

self .put (self.store[1])

Discussion 0
Questions 7

What is the expected output of the following snippet?

Options:

A.  

True False

B.  

True True

C.  

False False

D.  

False True

Discussion 0
Questions 8

A class constructor (Select two answers)

Options:

A.  

can return a value

B.  

cannot be invoked directly from inside the class

C.  

can be invoked directly from any of the subclasses

D.  

can be invoked directly from any of the superclasses

Discussion 0
Questions 9

Assuming that the V variable holds an integer value to 2, which of the following operators should be used instead of OPER to make the expression equal to 1?

V OPER 1 -

Options:

A.  

<<<

B.  

>>>

C.  

>>

D.  

<<

Discussion 0
Questions 10

What is the expected behavior of the following code?

Options:

A.  

it outputs -2

B.  

it outputs 2. 0

C.  

it outputs 0. 0

D.  

the code is erroneous and it will not execute

Discussion 0
Questions 11

Files with the suffix .pyc contain:

Options:

A.  

Python 4 source code

B.  

backups

C.  

temporary data

D.  

semi-compiled Python code

Discussion 0
Questions 12

What is the expected output of the following snippet?

Options:

A.  

the code is erroneous

B.  

3

C.  

7

D.  

15

Discussion 0
Questions 13

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

Options:

A.  

is instance(obj_b,C)

B.  

C._C__VarA == 2

C.  

has atr (B, 'get')

D.  

obj_c.get() == 2

Discussion 0
Questions 14

What is the expected output of the following code?

Options:

A.  

abcef

B.  

The program will cause a runtime exception error

C.  

acdef

D.  

abdef

Discussion 0
Questions 15

Which of the following words can be used as a variable name? (Select two valid names)

Options:

A.  

for

B.  

True

C.  

true

D.  

For

Discussion 0
Questions 16

The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX?

Options:

A.  

print (get(self))

B.  

print (self.get())

C.  

print (get())

D.  

print (self.get (val))

Discussion 0
Questions 17

What is the expected behavior of the following snippet?

It will:

Options:

A.  

cause a runtime exception on line 02

B.  

cause a runtime exception on line 01

C.  

cause a runtime exception on line 03

D.  

print3

Discussion 0
Questions 18

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

Options:

A.  

'var' in Object.__dict__

B.  

'prop' in Class.__dict

C.  

len(Object.__diet__) == 1

D.  

'var1 in Class, dict

Discussion 0
Questions 19

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:

Options:

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

Discussion 0
Questions 20

The following expression

1+-2

is:

Options:

A.  

equal to 1

B.  

invalid

C.  

equal to 2

D.  

equal to -1

Discussion 0
Questions 21

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

String[1:-2]

is shorter than the original string by:

Options:

A.  

four chars

B.  

three chars

C.  

one char

D.  

two chars

Discussion 0