Design a Python program to demonstrate the concept of Abstraction using abstract classes and methods.
Create an abstract class named Shape using the ABC module. The class should contain:
area()perimeter()Then create the following child classes:
Rectangle
length, widthCircle
radiusEach child class must implement the abstract methods area() and perimeter() according to its own formula.
Shape.Rectangle and Circle.Display:
Shape: Rectangle
Area: 50
Perimeter: 30
Shape: Circle
Area: 78.5
Perimeter: 31.4
__init__) to initialize attributes.After completing this practical exam, students will be able to:
Abstraction helps in hiding implementation details and showing only essential features to the user. ([gyata.ai][1])
| [1]: https://yasirbhutta.github.io/python/docs/oop-abstraction/ “OOP Abstraction | Learn with Yasir” |