Decoraters in python

Vedio is very complex.unable to understand the working of decoraters.sir pls explain it in a simple way.

Decorators allows us to modify the behavior of function or class. Decorators allow us to wrap another function in order to extend the behavior of wrapped function, without permanently modifying it.In Decorators, functions are taken as the argument into another function and then called inside the wrapper function.

def show(name):
      print("Hello {}".format(name))
show = login_required(show)

Above code is similar as -

@login_required
def show(name):
   print("Hello {}".format(name))

Where login_required() is same in both the cases.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.