Question OOP-ABS-0043
MediumWhat is the output of this code?
from abc import ABC, abstractmethod
class Payment(ABC):
@abstractmethod
def pay(self, amt): ...
class Card(Payment):
def pay(self, amt): return amt * 1.02
try:
Payment()
except TypeError:
print("cannot", end=" ")
print(Card().pay(100))
- A.
102.0
- B.
TypeError
- C.
Sign up free to see the answer and a step-by-step explanation.