Winter Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: v4s65

PCAP-31-03 Exam Dumps - Certified Associate in Python Programming

Go to page:
Question # 17

What is the expected output of the following code?

A.

21

B.

2

C.

3

D.

12

Full Access
Question # 18

What is the expected behavior of the following code?

A.

it outputs 2

B.

the code is erroneous and it will not execute

C.

it outputs 1

D.

it outputs 3

Full Access
Question # 19

What can you deduce from the following statement? (Select two answers)

str = open('file.txt', "rt")

A.

str is a string read in from the file named file.txt

B.

a newlina character translation will be performed during the reads

C.

if file. txt does not exist, it will be created

D.

the opened file cannot be written with the use of the str variable

Full Access
Question # 20

You are going to read 16 bytes from a binary file into a bytearray called data. Which lines would you use? (Select two answers)

A.

data = bytearray (16) bf.readinto (data)

B.

data = binfile.read (bytearray (16))

C.

bf. readinto (data = bytearray (16))

D.

data = bytearray (binfile.read (16))

Full Access
Question # 21

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)

A.

put self.store(1])

B.

self put stire(1])

C.

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

D.

self .put (self.store[1])

Full Access
Question # 22

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

import random

v1 = random. random()

v2 = random. random()

A.

len(random.sample([1,2,3],2)) > 2

B.

v1 == v2

C.

random.choice([1,2,3]) >=1

D.

v1 >= 1

Full Access
Go to page: