Black Friday Sale - Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70dumps

PCAP-31-03 Questions and Answers

Question # 6

You are going to read just one character from a stream called s. Which statement would you use?

A.

ch = read(s, 1)

B.

ch = s. input(1)

C.

ch = input(s, 1)

D.

ch = s. read(l)

Full Access
Question # 7

If you need a function that does nothing, what would you use instead of XXX? (Select two answers)

def idler ( ):

XXX

A.

pass

B.

return

C.

exit

D.

None

Full Access
Question # 8

The__bases__property contains:

A.

base class locations (addr)

B.

base class objects (class)

C.

base class names (str)

D.

base class ids (int)

Full Access
Question # 9

What can you do if you don't like a long package path tike this one0 import alpha.beta.gamma.delta.epsiIon.zeta

A.

you can make an alias for the name using the a 1 i a s keyword

B.

nothing; you need to come to terms with it

C.

you can shorten it to alpha. zeta and Python will find the proper connection

D.

you can make an alias for the name using die as keyword

Full Access
Question # 10

If you want to access an exception object's components and store them in an object called e, you have to use the following form of exception statement

A.

except Exception(e):

B.

except e=Exception:

C.

except Exception as e:

D.

such an action is not possible in Python

Full Access
Question # 11

What is true about Object-Oriented Programming in Python? (Select two answers)

A.

if a real-life object can be described with a set of adjectives, they may reflect a Python object method

B.

the same class can be used many times to build a number of objects

C.

each object of the same class can have a different set of methods

D.

a subclass is usually more specialized than its superclass

Full Access
Question # 12

What is true about Python packages? (Select two answers)

A.

the__name__variable always contains the name of a package

B.

a package is a group of related modules

C.

the pyc extension is used to mark semi-compiled Python packages

D.

a package is a single file whose name ends with the pa extension

Full Access
Question # 13

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

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

Full Access
Question # 14

What is the expected output of the following snippet?

A.

3

B.

1

C.

2

D.

the code is erroneous

Full Access
Question # 15

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

Full Access
Question # 16

The following class hierarchy is given. What is the expected out of the code?

A.

BB

B.

CC

C.

AA

D.

BC

Full Access
Question # 17

What is the expected output of the following code if existing_file is the name of a file located inside the working directory?

A.

1 2

B.

1 2 3

C.

1 3

D.

2 3

Full Access
Question # 18

What is the expected output of the following snippet?

A.

abc

B.

The code will cause a runtime exception

C.

ABC

D.

123

Full Access
Question # 19

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

A.

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

B.

'phd' in 'alpha'

C.

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

D.

'True' not in 'False'

Full Access
Question # 20

What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?

A.

0

B.

-1

C.

an errno value corresponding to file not found

D.

2

Full Access
Question # 21

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

A.

'var' in Object.__dict__

B.

'prop' in Class.__dict

C.

len(Object.__diet__) == 1

D.

'var1 in Class, dict

Full Access
Question # 22

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

A.

_upper_

B.

_bases_

C.

_ancestors_

D.

_super_

Full Access