Skip to content

Object Oriented Programming :Using Databases with Python (Python for Everybody Specialization) Answers 2025

Question 1

Which came first, the instance or the class?

class
❌ instance
❌ method
❌ function

Explanation:
A class defines the blueprint or template for objects — therefore, it must exist before any instances can be created from it.


Question 2

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

fields
❌ messages
❌ portions
❌ methods
❌ forms

Explanation:
Attributes (or properties) store data inside an object — they are also known as 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.

class
❌ cache
❌ instance
❌ method
❌ constructor

Explanation:
Python refers to the class definition to know what variables (attributes) and methods the new object will have.


Question 4

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

direction
❌ pattern
❌ template
❌ blueprint

Explanation:
A class acts like a blueprint/template — but not a “direction.”


Question 5

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

zap = PartyAnimal()

Use the PartyAnimal template to make a new object and assign it to zap
❌ Subtract zap from PartyAnimal
❌ Copy the value from PartyAnimal to zap
❌ Clear data in PartyAnimal

Explanation:
This creates a new instance (object) of the PartyAnimal class and stores it in variable zap.


Question 6

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

colleen.fullname
❌ colleen[‘fullname’]
❌ colleen::fullname
❌ colleen->fullname

Explanation:
Object attributes are accessed using the dot operator (object.attribute).


Question 7

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

class A(B):
❌ class A instanceOf B :
❌ class A inherits B :
❌ A=B++