Summer Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ecus65

Python Institute PCAP-31-03 - Certified Associate in Python Programming

Page: 1 / 5
Total 147 questions

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:

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

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

A.

'in not' in 'not'

B.

'in' in 'Thames'

C.

't' . upper ( ) in 'Thames'

D.

'in' in 'in'

A variable stored separately in every object is called:

A.

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

B.

a class variable

C.

an object variable

D.

an instance variable

If you want to transform a string into a list of words, what invocation would you use? (Select two answers)

Expected output:

A.

s.split ()

B.

split (s, "˜ "˜)

C.

s.split ("˜ "˜)

D.

split (s)

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

A.

open () requires a second argument

B.

open () is a function which returns an object that represents a physical file

C.

instd, outstd, errstd are the names of pre-opened streams

D.

if invoking open () fails, an exception is raised

Which of the following snippets will execute without raising any unhandled exceptions? (Select answers)

A)

B)

C)

D)

A.

Option A

B.

Option B

C.

Option C

D.

Option D

What is the expected behavior of the following snippet?

It will:

A.

cause a runtime exception

B.

print 1

C.

print 0 , [1]

D.

print [1J

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

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

What is the expected output of the following snippet?

A.

3

B.

1

C.

2

D.

the code is erroneous

Assuming that the following inheritance set is in force, which of the following classes are declared properly? (Select two answers)

A.

class Class_4 (D, A) : pass

B.

class Class_1(C,D): pass

C.

class Class_3(A,C): pass

D.

class Class_2(B,D): pass