What is the output of the following code? def s1(x, y): return x*y class A: @staticmethod def s1(x, y): return x + y def s2(self, x, y): return s1(x, y) a = A() print(a.s2(3, 7))

Questions & AnswersCategory: Programming LanguageWhat is the output of the following code? def s1(x, y): return x*y class A: @staticmethod def s1(x, y): return x + y def s2(self, x, y): return s1(x, y) a = A() print(a.s2(3, 7))
Adam asked 3 years ago

What is the output of the following code?

def s1(x, y):

    return x*y

class A:

    @staticmethod

    def s1(x, y):

        return x + y

    def s2(self, x, y):

        return s1(x, y)

a = A()

print(a.s2(3, 7))

 
a. 10
b. 4
c. TypeError
d. 21