Home / MCQ Bank / Computer
Computer Formatting And Decorators

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()

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option B • mk()

Related Computer Questions

How do you check the truthiness of a value in Ruby? In how many different ways we can reach the end of the array arr[]={1,3,5,8,9}? What is the difference between std::async and std::thread in C++ multi-threading? Which of the following is the default mode of the opening using the ofstream class? Consider the following heap after buildheap phase. What will be its corresponding array?