Coursera | Using Databases with Python

Object Oriented Programming

Object Oriented Programming >> Using Databases with Python

*Please Wait 15 Seconds To Get The Pdf Loaded

* Please Disable Internet Download Manager (IDM) To View This Pdf.

L^U&M56q1Mzm

Question 1

Which came first, the instance or the class?

1 point
 

class

method

function

instance

 

Question 2

In Object Oriented Programming, what is another name for the “attributes” of an object?

1 point
 

methods

portions

messages

forms

fields

 

Question 3

At the moment of creation of a new object, Python looks at the _________ definition to define the structure and capabilities of the newly created object.

1 point
 

method

class

cache

instance

constructor

 

Question 4

Which of the following is NOT a good synonym for “class” in Python?

1 point
 

pattern

direction

template

blueprint

 

Question 5

What does this Python statement do if PartyAnimal is a class?

1 point
 

Clear out all the data in the PartyAnimal variable and put the old values for the data in zap

Copy the value from the PartyAnimal variable to the variable zap

Use the PartyAnimal template to make a new object and assign it to zap

Subtract the value of the zap variable from the value in the PartyAnimal variable and put the difference in zap

 

Question 6

What is the syntax to look up the fullname attribute in an object stored in the variable colleen?

1 point
 

colleen[‘fullname’]

colleen.fullname

colleen::fullname

colleen->fullname

 

Question 7

Which of these statements is used to indicate that class A will inherit all the features of class B?

1 point
 

A=B++;

class A(B) :

class A inherits B :

class A extends B :

class A instanceOf B :

 

Question 8

What keyword is used to indicate the start of a method in a Python class?

1 point
 

break

def

function

continue

 

Question 9

What is “self” typically used for in a Python method within a class?

1 point
 

The number of parameters to the method

To set the residual value in an expression where the method is used

To refer to the instance in which the method is being called

To terminate a loop

 

Question 10

What does the Python dir() function show when we pass an object into it as a parameter?

1 point
 

It shows the methods and attributes of the object

It shows the number of parameters to the constructor

It shows the type of the object

It shows the parent class

 

Question 11

Which of the following is rarely used in Object Oriented Programming?

1 point
 

Constructor

Attribute

Destructor

Method

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *