What is the output of following code? from abc import ABC, abstractmethod class A(ABC): @abstractmethod def m1(): print('In class A, Method m1.') def m2(): print('In class A, Method m2.') class B(A): def m2(): print('In class B, Method m2.') b = B() b.m2()

Questions & AnswersCategory: Programming LanguageWhat is the output of following code? from abc import ABC, abstractmethod class A(ABC): @abstractmethod def m1(): print('In class A, Method m1.') def m2(): print('In class A, Method m2.') class B(A): def m2(): print('In class B, Method m2.') b = B() b.m2()
Adam asked 3 years ago

What is the output of following code?

from abc import ABC, abstractmethod

class A(ABC):

    @abstractmethod

    def m1():

        print('In class A, Method m1.')

    def m2():

        print('In class A, Method m2.')

class B(A):

    def m2():

        print('In class B, Method m2.')

b = B()

b.m2()

 
a. In class A, Method m2.
b. In class A, Method m1.
c. In class B, Method m2.
d. TypeError