0% found this document useful (0 votes)
8 views2 pages

Intro Inheritance

Inheritance allows a class to acquire features from an existing class, resembling a parent-child relationship. It promotes code reusability and every class in Python inherits from the object class. For example, a cuboid can access features of a rectangle due to their similarities.

Uploaded by

rpatnaik1997
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Intro Inheritance

Inheritance allows a class to acquire features from an existing class, resembling a parent-child relationship. It promotes code reusability and every class in Python inherits from the object class. For example, a cuboid can access features of a rectangle due to their similarities.

Uploaded by

rpatnaik1997
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction to Inheritance

• Inheritance is acquiring features in a class from an existing class


• Inheritance is like parent - child relation , a child class can have all of its parent
features plus his own features

• The main advantage of Inheritance is reusability of code


• Every class in python directly or indirectly is inheriting from object class
• Suppose you want to access features of rectangle in cuboid as they are almost
same then you can do the following
Rectangle Cuboid

height
breath

length
length
breath

You might also like