LESSON 3 Flashcards
_______
user-defined ______ or prototype from which objects are created.
- Class
- Blueprint
provide a means of _______ and functionality together.
- Classes
- Bundling data
are variables that belong to a class
Attributes
are always _____ and can
be accessed using the dot (.) operator.
- Attributes
- Public
is an instance of a Class
Object
like a blueprint while an instance is
a copy of the class with actual values
Class
It is represented by the attributes of an
object. It also reflects the properties of an object.
State
It is represented by the methods of an
object. It also reflects the response of an object to other objects.
Behavior
It gives a unique name to an object and
enables one object to interact with other objects.
Identity
DECLARING CLASS OBJECTS
(also known as instantiating a class)
When an object of a class is created,
the class is said to be instantiated.
● Alltheinstancessharetheattributes
and the behavior of the class. But the values of those attributes, i.e. the state are unique for each object.
● A single class may have any number of instances.
When we call a method of this object as pyobject.method(arg1, arg2), this is automatically converted by Python into PyClass.method(myobject, arg1, arg2) – this is all the special self is about.
Self Parameter
The Self Parameter does not require for you to name it “______”. Other wise? __________You can use _______ instead of it.
- Self
- any other name
- The program’s execution is unaffected by the pass statement’s inaction.
- It merely permits the program to skip past that section of the code without doing anything.
Pass Parameter
syntactic constraints of Python demand a valid statement but no useful code must be executed.
Pass Parameter
similar to constructors in C++ and Java. Constructors are used to initializing the object’s state.
_ init _() method