Spring Sale Special - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: sntaclus

How many elements will the list2 list contain after execution of the following snippet?

list1 = [False for i in range (1, 10) ]

list2 = list1 [-1:1:-1]

A.

zero

B.

five

C.

seven

D.

three

What is the expected behavior of the following code?

A.

it outputs -2

B.

it outputs 2. 0

C.

it outputs 0. 0

D.

the code is erroneous and it will not execute

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 listed actions can be applied to the following tuple? (Select two answers)

A.

tup [:]

B.

tup.append (0)

C.

tup [0]

D.

del tup

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

A.

a ( ) == 4

B.

a is not None

C.

b ( ) == 4

D.

a ! = b

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'

What is the expected behavior of the following snippet?

It will:

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

What is a true about python class constructors? (Select two answers)

A.

the constructor must have at least one parameter

B.

the constructor must return a value other than None

C.

the constructor is a method named_init_

D.

there can the more than one constructor in a Python class.

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

What is the expected behavior of the following code?

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]