LESSON 3 Flashcards
__ is a user-defined blueprint or prototype from which objects are created. __ provide a means of bundling data and functionality together
class, Classes
Creating a new class creates a new type of ___, allowing new instances of that type to be made.
object
creates a user-defined data structure, which holds its own data members and member functions, which can be accessed and used by creating an instance of that class.
Class
is like a blueprint for an object
Class
Some points on Python class:
● Classes are created by keyword class.
● Attributes are the variables that belong to a class.
● Attributes are always public and can be accessed using the dot (.) operator. Eg.: My class.Myattribute
An ___ is an instance of a Class
Object
A class is like a ___while an instance is a ___ of the class with actual values
blueprint, copy
It is represented by the methods of an object. It also reflects the response of an object to other objects.
Behavior:
● An object consists of:
State:
Behavior:
Identity:
It is represented by the attributes of an object. It also reflects the properties of an object
State:
DECLARING CLASS OBJECTS is also known as
instantiating a class
It gives a unique name to an object and enables one object to interact with other objects
Identity:
When an object of a class is created,
the class is said to be
instantiated
All the ___ share the attributes
and the behavior of the class. But the
values of those attributes, i.e. the state
are __for each object.
instances, unique
A __ __ may have any number of
instances.
single class