Question
What will be the output of the following code snippet
demonstrating abstraction in Python? from abc import ABC, abstractmethod class Shape(ABC):   @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())Solution
In the given code snippet, an abstract base class Shape is defined with an abstract method area. The Circle class inherits from Shape and implements the area method, which calculates the area of a circle using the formula πr2\pi r^2πr2. When the Circle instance with a radius of 5 is created, calling circle.area() computes the area as 3.14×5×5=78.53.14 \times 5 \times 5 = 78.53.14×5×5=78.5. Therefore, the output is 78.5. Why Other Options Are Wrong: A) 3.14: This option is incorrect because it only represents the value of π, not the computed area. B) 31.4: This option is incorrect as it suggests a miscalculation of the area, possibly interpreting it as π multiplied by the radius. D) 25: This option is incorrect because it reflects the square of the radius (5), not the area. E) TypeError: This option is incorrect because there is no type error; the code correctly implements abstraction and executes without issues.
During his visit to Italy in May 2026, PM Narendra Modi was honoured with the Agricola Medal, which is the highest honour of which organisation?
Which new benchmark has the RBI introduced to replace MIBOR?
Who among the following has been honoured with Indian Film Personality of the Year at 53rd IFFI?
Which financial institution's rating forecast for India's GDP growth for FY25 was raised to 7%?
Rearranging the letters "AKBLU", we get the capital of ______
- How many government schools were assessed under ASER 2024?
Which logistics company  has joined ONDC (Open Network for Digital Commerce), enabling Pan India delivery services to over 20,000 pin codes?Â
...What is the theme of the 81st plenary meeting of the International Cotton Advisory Committee (ICAC)?
BimaKavach has received a direct insurance broking licence from the Insurance Regulatory and Development Authority of India (IRDAI), enabling the firm t...
As per Morgan Stanley’s projections in April 2026, what is India’s Current Account Deficit (CAD) expected to be as a percentage of GDP in FY27?