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

Is it possible to safely check if a class object has a certain attribute0

A.

yes, by using the hasattr attribute

B.

yes. by using the hasattr () method

C.

yes, by using the hasattr () function

D.

no, it is not possible

What is the expected output of the following snippet?

A.

3

B.

1

C.

2

D.

the code is erroneous

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

A.

len('\'•) == 1

B.

len("""

""") == o

C.

chr(ordCA') + 1) == 'B'

D.

ord("Z") - ord("z") -- ord("0")

You need data which can act as a simple telephone directory. You can obtain it with the following clauses (choose two relevant variants; assume that no other items have been created before)

A.

dir={'Mom':5551234567, 'Dad':5557654321>

B.

dir={'Mom':'5551234567', * Dad':'5557654321'}

C.

dir={Mom:5551234567, Dad:5557654321}

D.

dir={Mom:'5551234567', Dad:'5557654321'}

With regards to the directory structure below, select the proper forms of the directives in order to import module_c. (Select two answers)

A.

from pypack.upper.lower import module_c

B.

import pypack.upper.lower.module_c

C.

import upper.module_c

D.

import upper.lower.module_c

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

A.

the constructor's first parameter identifies an object currently being created

B.

the constructor cannot use the default values of the parameters

C.

the constructor can be invoked directly under strictly defined circumstances

D.

super-class constructor is invoked implicitly during constructor execution

What is the expected behavior of the following code?

A.

it outputs 'None'

B.

it outputs 3

C.

it raises an exception

D.

it outputs 0

The__bases__property contains:

A.

base class locations (addr)

B.

base class objects (class)

C.

base class names (str)

D.

base class ids (int)

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 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