Discussion :: Python MCQs
-
In the code shown below, which function is the decorator?def mk(x):def mk1():print("Decorated")x()return mk1def mk2():print("Ordinary")p = mk(mk2)p()
Answer : Option B
Explanation :
In the code shown above, the function mk() is the decorator. The function which is getting decorated is mk2(). The return function is given the name p().
Be The First To Comment