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

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

Questions 4

What is the expected output of the following code?

Options:

A.

a

B.

an exception is raised

C.

b

D.

c

Buy Now
Questions 5

Which of the following statements are true? {Select two answers)

Options:

A.

an escape sequence can be recognized by the / sign put in front of it

B.

II in ASCII stands for Internal Information

C.

ASCII is a subset of UNICODE

D.

a code point is a number assigned to a given character

Buy Now
Questions 6

A property that stores information about a given class's super-classes is named:

Options:

A.

_upper_

B.

_bases_

C.

_ancestors_

D.

_super_

Buy Now
Questions 7

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

Options:

A.

\e is an escape sequence used to mark the end of lines

B.

ASCII is synonymous with UTF-8

C.

II in ASCII stands for Information Interchange

D.

a code point is a number assigned to a given character

Buy Now
Questions 8

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

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

Options:

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

Buy Now
Questions 9

Which of the following lambda function definitions are correct? (Select two answers)

Options:

A.

lambda X : None

B.

lambda : 3,1415

C.

lambda x : def fun(x): return x

D.

lambda lambda: lambda * lambda

Buy Now
Questions 10

What is the expected output of the following code?

Options:

A.

21

B.

2

C.

3

D.

12

Buy Now
Questions 11

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

Options:

A.

a is b

B.

b( ) > 2

C.

a() > 2

D.

a is not None

Buy Now
Questions 12

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 13

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 14

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 15

What is the expected output of the following code?

Options:

A.

3

B.

5

C.

4

D.

an exception is raised

Buy Now
Questions 16

What is the expected behavior of the following code?

It will

Options:

A.

print 2 1

B.

print 1 2

C.

cause a runtime exception

D.

print

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 expressions evaluate to True? (Select two answers)

Options:

A.

' t '.upper () in 'Thames'

B.

'in not' in 'not'

C.

'not' not in 'in'

D.

'a' not in 'ABC' .lower ()

Buy Now
Questions 19

What is the expected output of the following code?

Options:

A.

2

B.

3

C.

4

D.

an exception is raised

Buy Now
Questions 20

A variable stored separately in every object is called:

Options:

A.

there are no such variables, all variables are shared among objects

B.

a class variable

C.

an object variable

D.

an instance variable

Buy Now
Questions 21

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.

<<

Buy Now
Questions 22

Python strings can be “glued” together using the operator:

Options:

A.

.

B.

&

C.

_

D.

+

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

PDF + Testing Engine

$134.99

Testing Engine

$99.99

PDF (Q&A)

$84.99