Vidyalelo
Python · Q30

Formatting and Decorators

Programming · Python · question 30

Q30

What will be the output of the following Python code? def c(f): def inner(*args, **kargs): inner.co += 1 return f(*args, **kargs) inner.co = 0 return inner @c def fnc(): pass if __name__ == '__main__': fnc() fnc() fnc() print(fnc.co)

A.
4
B.
3
Answer
C.
0
D.
1

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board