right nowgetting an erroror exceptionin your python program means the entire program will crash you don' want this to happen in real-world programs insteadyou want the program to detect errorshandle themand then continue to run for exampleconsider the following programwhich has divide-byzero error open file editor window and enter the following codesaving it as zerodivide pydef spam(divideby)return divideby print(spam( )print(spam( )print(spam( )print(spam( )we've defined function called spamgiven it parameterand then printed the value of that function with various parameters to see what happens this is the output you get when you run the previous code traceback (most recent call last)file " :/zerodivide py"line in print(spam( )file " :/zerodivide py"line in spam return divideby zerodivisionerrordivision by zero you can view the execution of this program at /zerodividea zerodivisionerror happens whenever you try to divide number by zero from the line number given in the error messageyou know that the return statement in spam(is causing an error errors can be handled with try and except statements the code that could potentially have an error is put in try clause the program execution moves to the start of following except clause if an error happens you can put the previous divide-by-zero code in try clause and have an except clause contain code to handle what happens when this error occurs def spam(divideby)tryreturn divideby except zerodivisionerrorprint('errorinvalid argument 'print(spam( )print(spam( )print(spam( )print(spam( )functions