Show the printout of the following program:
class A:
def __init__(self, i):
self.i = i
def __str__(self):
return "A"
class B(A):
def __init__(self, i, j):
super().__init__(i)
self.j = j
def main():
b = B(1, 2)
a = A(1)
print(a)
print(b)
main() # Call the main function
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.