deftest1(x): return x **2 deftest2(x): return x *3+ x /2 test1(6) test2(8) deffunc(f): deffNew(x): print(f.__name__) return f(x) return fNew f = func(test1) print(f(4)) f = func(test2) print(f(4)) @func deftest3(x): return x *10*(x +1) rst = test3(6) print(rst) from functools import wraps defa_new_decorator(a_func): @wraps(a_func) defwrapTheFunction(): print("I am doing some boring work before executing a_func()") a_func() print("I am doing some boring work after executing a_func()") return wrapTheFunction @a_new_decorator defa_function_requiring_decoration(): """Hey yo! Decorate me!""" print("I am the function which needs some decoration to " "remove my foul smell") print(a_function_requiring_decoration.__name__) a_function_requiring_decoration()