Python_OOPs
Python_OOPs
• The real world entity that has state and behavior is known
as an object e.g. chair, bike, pen, table, car, mobile,bird
etc.
• Object is an instance of a class.
• An object has three characteristics:
state: represents data (value) of an object.
behavior: represents the behavior (functionality) of an object.
identity: Object identity Name or ID.
• Object-Oriented Programming is a methodology or paradigm
to design a program using classes and objects
Instructor: Charulata Palai
Python
Object in Python
• A class is a template or blueprint from which objects
are created. So, an object is the instance(result) of a
class.
• Object Definitions:
– An object is a real-world entity.
– An object is a runtime entity which has state and
behavior.
– The object is an instance of a class.
class Point(object):
def __init__(self):
print("Point Const")
class Line(Point):
def __init__(self):
Point.__init__(self)
print("Line Const")
class Rectangle(Line):
def __init__(self):
Line.__init__(self)
print("Rectangle Const")
class Cube(Rectangle):
def __init__(self):
Rectangle.__init__(self)
print("Cube Const")
c = Cube()
Instructor: Charulata Palai
Python
THANK
YOU
Instructor: Charulata Palai