Explain inheritance class with suitable example.
in python?
Answers
Answered by
2
Answer:
Inheritance enables us to define a class that takes all the functionality from a parent class and allows us to add more. In this tutorial, you will learn to use inheritance in Python.
Explanation:
To demonstrate the use of inheritance, let us take an example.
A polygon is a closed figure with 3 or more sides. Say, we have a class called Polygon defined as follows.
Similar questions
Math,
3 months ago
Social Sciences,
3 months ago
Math,
3 months ago
English,
6 months ago
Math,
6 months ago
Political Science,
10 months ago
English,
10 months ago
Math,
10 months ago