Question OOP-ABS-0010
MediumWhat is the output of this code?
from abc import ABC, abstractmethod
class Shape(ABC):
@abstractmethod
def area(self):
pass
class Rect(Shape):
def __init__(self, w, h):
self.w, self.h = w, h
def area(self):
return self.w * self.h
print(Rect(3.0, 4).area())
- A.
0
- B.
12.0
- C.
Sign up free to see the answer and a step-by-step explanation.