Vidyalelo
Python · Q82

Formatting and Decorators

Programming · Python · question 82

Q82

Which of the following is a correct way to define a decorator function in Python?

A.
def my_decorator(func):
def wrapper():
B.
def wrapper():
def my_decorator(func):
C.
def decorator():
def func_wrapper():
Answer
D.
def func_wrapper():
def decorator(func):

Answer: Option C

Solution

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