Objects and Classes Flashcards
Object-oriented programming enables you to develop large-scale ________ and _______ effectively.
software and GUIs
A class defines the properties and behaviors for _________.
objects
An object represents an entity in the real world that can be distinctly ________.
identified
What is Object-oriented programming (OOP)?
It’s an approach to programming that involves organizing objects and their behavior into classes of reusable components.
An objects has both a ______ and _______.
state and behavior.
A Python class uses _______ to store ____ _____ and defines ______ to perform ______. Additionally, a class provides a special type method, known as ______, which is invoked to create a new ______.
A Python class uses variables to store data fields and defines methods to perform actions. Additionally, a class provides a special type method. known as initializer, which is invoked to create a new object.
How do you define a class?
Define the initializer, create data fields, and define methods.
How do you create an object?
Use a constructor.
_______ is a template, blueprint, or contract that defines objects of the same type.
A class
The keyword __________ is required to define a class.
Class
Once a class is defined, you can create objects from the class with a ________. The ________ does two things:
It creates an _____ in the memory for the ______.
It invokes the class’s ______ method to initialize the object.
constructor constructor object class \_\_init\_\_
The syntax for a constructor is:
ClassName(arguments)
What is the name of the initializer method?
__init__
________ is used to create an object.
A constructor
An object is an instance of a __________.
class