What is the output of the following code? def outer(x, y): def inner1(): return x+y def inner2(z): return inner1() + z return inner2 f = outer(10, 25) print(f(15))

Questions & AnswersCategory: Programming LanguageWhat is the output of the following code? def outer(x, y): def inner1(): return x+y def inner2(z): return inner1() + z return inner2 f = outer(10, 25) print(f(15))
Adam asked 3 years ago

What is the output of the following code?

def outer(x, y):

    def inner1():

        return x+y

    def inner2(z):

        return inner1() + z

    return inner2

f = outer(10, 25)

print(f(15))

 
a. 50
b. Error
c. 60
d. 45