Python 1
Python 1
Object Class
A real-world entity which is an A class is basically a template or a
instance of a class blueprint within which objects can
be created
An object acts like a variable of Binds methods and data together
the class into a single unit
An object is a physical entity A class is a logical entity
Objects take memory space when A class does not take memory
they are created space when created
Objects can be declared as and Classes are declared just once
when required
What is inheritance?
Inheritance is a feature of OOPs which allows classes inherit common
properties from other classes.
For example, if there is a class such as ‘vehicle’, other classes like
‘car’, ‘bike’, etc can inherit common properties from the vehicle class.
This property helps you get rid of redundant code thereby reducing
the overall size of the code.
What are the different types of inheritance?
Single inheritance
Multiple inheritance
Multilevel inheritance
Hierarchical inheritance
Hybrid inheritance