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

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

Questions 4

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

A)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 5

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 6

There is a stream named s open for writing. What option will you select to write a line to the stream''

Options:

A.

s.write("Hello\n")

B.

write(s, "Hello")

C.

s.writeln("Hello")

D.

s.writeline("Hello")

Buy Now
Questions 7

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

string = 'python' [::2]

string = string[-1] + string[-2]

Options:

A.

string[0] == string[-1]

B.

string is None

C.

len (string] == 3

D.

string[0] == 'o'

Buy Now
Questions 8

You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)

Options:

A.

dir={'Mom':5551234567, 'Dad':5557654321>

B.

dir={'Mom':'5551234567', * Dad':'5557654321'}

C.

dir={Mom:5551234567, Dad:5557654321}

D.

dir={Mom:'5551234567', Dad:'5557654321'}

Buy Now
Questions 9

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 10

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 11

Which of the listed actions can be applied to the following tuple? (Select two answers)

Options:

A.

tup [:]

B.

tup.append (0)

C.

tup [0]

D.

del tup

Buy Now
Questions 12

What is the expected output of the following code?

Options:

A.

2

B.

3

C.

4

D.

an exception is raised

Buy Now
Questions 13

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

Options:

A.

'in not' in 'not'

B.

'in' in 'Thames'

C.

't' . upper ( ) in 'Thames'

D.

'in' in 'in'

Buy Now
Questions 14

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 15

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

Options:

A.

str(1-1) in '012345£739'[:2]

B.

'phd' in 'alpha'

C.

'deb' not in 'abcde' [::-1]

D.

'True' not in 'False'

Buy Now
Questions 16

What is the expected behavior of the following code?

Options:

A.

the code is erroneus and it will not execute

B.

it outputs [2, 4]

C.

it outputs [4, 2]

D.

it outputs [0, 1, 2, 3, 4]

Buy Now
Questions 17

If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:

Options:

A.

except Ex1 Ex2:

B.

except (ex1, Ex2):

C.

except Ex1, Ex2:

D.

except Ex1+Ex2:

Buy Now
Questions 18

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

Buy Now
Questions 19

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

Buy Now
Questions 20

Assuming that the math module has been successfully imported, which of the following expressions evaluate to True? (Select two answers)

Options:

A.

math. hypot (3,4) == math.sqrt (25)

B.

math. hypot (2,5) == math.truec (2.5)

C.

math. hypot (2,5) == math.true (2.5)

D.

math. cell (2,5) == math.floor (2.5)

Buy Now
Questions 21

Files with the suffix .pyc contain:

Options:

A.

Python 4 source code

B.

backups

C.

temporary data

D.

semi-compiled Python code

Buy Now
Questions 22

Is it possible to safely check if a class object has a certain attribute0

Options:

A.

yes, by using the hasattr attribute

B.

yes. by using the hasattr () method

C.

yes, by using the hasattr () function

D.

no, it is not possible

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

PCAP-31-03 PDF

$25.5  $84.99
PCAP-31-03 Engine

PCAP-31-03 Testing Engine

$30  $99.99
PCAP-31-03 PDF + Engine

PCAP-31-03 PDF + Testing Engine

$40.5  $134.99