Question
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
Was this answer helpful ?
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().
Was this answer helpful ?
Submit Solution