Tag: Decorators

  • Python Quizs Question and Answers – Decorators

    Q 1. In the following Python code, which function is the decorator? def mk(x): def mk1(): print(“Decorated”) x() return mk1 def mk2(): print(“Ordinary”) p = mk(mk2) p() A. p()B. mk()C. mk1()D. mk2() Show Answer Answer:-B. mk() Explanation In the code shown above, the function mk() is the decorator. The function which is getting decorated is…

You cannot copy content of this page