in this sectionwe saw the basics of the decoratorwhich we will be used in this tutorial decorator without arguments in following codedecorator takes function as the input and print the name of the function and return the function debugex py def printname(func)func is the function to be wrapped def pn(*args**kwargs)print(func __name__return func(*args**kwargsreturn pn nextput the printname function as decorator in the mathex py file as belowmathex py from debugex import printname @printname def add num(xy)add two numbers print("add"return( +yprint(add num( )help(add numfinallyexecute the code and the name of each function will be printed before calculation as shown belowpython mathex py add help on function pn in module debugexpn(*args**kwargsfunc is the function to be wrapped importantdecorator brings all the debugging code at one places now we can add more debugging features to 'debugex pyfile and all the changes will be applied immediately to all the functions warningdecorators remove the help features of the function along with name etc thereforewe need to fix it using functools as shown next rewrite the decorator using wraps function in functools as belowdebugex py from functools import wraps def printname(func)func is the function to be wrapped (continues on next page decorators