raise exception('height must be greater than 'print(symbol widthfor in range(height )print(symbol ((width )symbolprint(symbol widthfor symwh in (('*' )(' ' )(' ' )('zz' ))tryboxprint(symwhexcept exception as errprint('an exception happenedstr(err)you can view the execution of this program at here we've defined boxprint(function that takes charactera widthand heightand uses the character to make little picture of box with that width and height this box shape is printed to the screen say we want the character to be single characterand the width and height to be greater than we add if statements to raise exceptions if these requirements aren' satisfied laterwhen we call boxprint(with various argumentsour try/except will handle invalid arguments this program uses the except exception as err form of the except statement if an exception object is returned from boxprint(uvthis except statement will store it in variable named err we can then convert the exception object to string by passing it to str(to produce user-friendly error message when you run this boxprint pythe output will look like this******oooooooooooooooooooo oooooooooooooooooooo an exception happenedwidth must be greater than an exception happenedsymbol must be single character string using the try and except statementsyou can handle errors more gracefully instead of letting the entire program crash getting the traceback as string when python encounters an errorit produces treasure trove of error information called the traceback the traceback includes the error messagethe line number of the line that caused the errorand the sequence of the function calls that led to the error this sequence of calls is called the call stack debugging