Q. What is the output of class A: def show(self): return ‘A’ class B(A): def show(self): return ‘B’ print(B().show())?

A
A
B
B
C
Error
D
None
Solution:

B overrides show(), returning ‘B’ due to polymorphism.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!