Question

What will be the output of the following code snippet demonstrating abstraction in Python? from abc import ABC, abstractmethod class Shape(AB

  • C :     @abstractmethod     def area(self):         pass class Circle(Shape):     def __init__(self, radius):         self.radius = radius     def area(self):         return 3.14 * self.radius * self.radius circle = Circle(5) print(circle.area())
A 3.14
B 31.4
C 78.5
D 25
E TypeError
Practice Next

Relevant for Exams:

Hey! Ask a query