What is the output of the following code? def bind(func): func.data = 9 return func @bind def add(x, y): return x + y print(add(3, 10)) print(add.data)

Questions & AnswersCategory: Programming LanguageWhat is the output of the following code? def bind(func): func.data = 9 return func @bind def add(x, y): return x + y print(add(3, 10)) print(add.data)
Adam asked 3 years ago

What is the output of the following code?

def bind(func):

    func.data = 9

    return func

@bind

def add(x, y):

    return x + y

print(add(3, 10))

print(add.data)

a. 13
b. 9
c. 9
d. 13