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

PCAP-31-03 Certified Associate in Python Programming Questions and Answers

Questions 4

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)

Buy Now
Questions 5

Assuming that the following snippet has been successfully executed, which of the equations are False? (Select two answers)

Options:

A.

len(a)== len (b)

B.

a [0]-1 ==b [0]

C.

a[0] = b[0]

D.

b[0] - 1 == a[0]

Buy Now
Questions 6

What will be the value of the i variable when the while e loop finishes its execution?

Options:

A.

1

B.

0

C.

2

D.

the variable becomes unavailable

Buy Now
Questions 7

What is true about Python class constructors? (Choose two.)

Options:

A.

there can be more than one constructor in a Python class

B.

the constructor must return a value other than None

C.

the constructor is a method named __init__

D.

the constructor must have at least one parameter

Buy Now
Questions 8

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

Options:

A.

an integer value identifying an opened file

B.

an error code (0 means success)

C.

a stream object

D.

always None

Buy Now
Questions 9

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

Options:

A.

a ( ) == 4

B.

a is not None

C.

b ( ) == 4

D.

a ! = b

Buy Now
Questions 10

Which of the following sentences are true? (Select two answers)

Options:

A.

lists may not be stored inside tuples

B.

tuples may be stored inside lists

C.

tuples may not be stored inside tuples

D.

lists may be stored inside lists

Buy Now
Questions 11

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

Buy Now
Questions 12

What is the expected behavior of the following code?

Options:

A.

it outputs 0

B.

it outputs 1

C.

it raises an exception

D.

it outputs 2

Buy Now
Questions 13

What is the expected behavior of the following code?

Options:

A.

it outputs [1, 3]

B.

the code is erroneous and it will not execute

C.

it outputs [3, 1]

D.

it outputs [4, 2, 0]

Buy Now
Questions 14

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

Buy Now
Questions 15

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

Buy Now
Questions 16

What is the expected output of the following code if the file named existing_text_file is a non-zero length text file located inside the working directory?

Options:

A.

the length of the first line from the file

B.

-1

C.

the number of lines contained inside the file

D.

the length of the last line from the file

Buy Now
Questions 17

What is the expected behavior of the following code?

Options:

A.

it outputs 1

B.

it outputs 2

C.

the code is erroneous and it will not execute

D.

it outputs 3

Buy Now
Questions 18

Which of the following expressions evaluate to True? (Select two answers)

Options:

A.

11 == '011'

B.

3 * 'a' < 'a' * 2

C.

'abc' .upper () < 'abc'

D.

'1' + '2' * 2 !=2 '12'

Buy Now
Questions 19

What is the expected output of the following snippet?

Options:

A.

abc

B.

The code will cause a runtime exception

C.

ABC

D.

123

Buy Now
Questions 20

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])

Buy Now
Questions 21

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

Buy Now
Questions 22

How many lines does the following snippet output?

Options:

A.

three

B.

one

C.

two

D.

four

Buy Now
Exam Code: PCAP-31-03
Exam Name: Certified Associate in Python Programming
Last Update: May 1, 2024
Questions: 145
PCAP-31-03 pdf

PCAP-31-03 PDF

$28  $80
PCAP-31-03 Engine

PCAP-31-03 Testing Engine

$33.25  $95
PCAP-31-03 PDF + Engine

PCAP-31-03 PDF + Testing Engine

$45.5  $130