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

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

What is the output of the following code?

from abc import ABC, abstractmethod

class A(ABC):

    @classmethod

    @abstractmethod

    def m1(self):

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

class B(A):

    @classmethod

    def m1(self):

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

b = B()

b.m1()

B.m1()

A.m1()

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