(continued from previous page'''add two numbers''return( + @printname def diff num(xy)'''subtract two integers only''return( -yprint(add num( )print(diff num( )help(add numnext execute the codepython mathex py **add num diff num - dry decorator with arguments in previous codewe repeated the same code two time for creating the decorator with and without arguments butthere is better way to combine both the functionality in one decorator using partial function as shown belowdebugex py from functools import wrapspartial def printname(func=none*prefix="")if func is nonereturn partial(printnameprefix=prefixwrap is used to exchange metadata between functions @wraps(funcdef pn(*args**kwargs)print(prefix func __name__return func(*args**kwargsreturn pn nowmodify the mathex py remove printnamearg decorator from the codeas belowmathex py from debugex import printname @printname(prefix='**'def add num(xy)'''add two numbers''return( + @printname def diff num(xy)'''subtract two integers only''return( -yprint(add num( )print(diff num( )help(add numnextrun the code and it will display following results decorators