linefollowed by block of (usuallyindented statementsthen one or more except clauses that identify exceptions to be caught and blocks to process themand an optional else clause and block at the end you associate the words tryexceptand else by indenting them to the same level ( lining them up verticallyfor referencehere' the general and most complete format in python xtrystatements except name statements except (name name )statements except name as varstatements exceptstatements elsestatements run this main action first run if name is raised during try block run if any of these exceptions occur run if name is raisedassign instance raised to var run for all other exceptions raised run if no exception was raised during try block semanticallythe block under the try header in this statement represents the main action of the statement--the code you're trying to run and wrap in error processing logic the except clauses define handlers for exceptions raised during the try blockand the else clause (if codedprovides handler to be run if no exceptions occur the var entry here has to do with feature of raise statements and exception classeswhich we will discuss in full later in this how try statements work operationallyhere' how try statements are run when try statement is enteredpython marks the current program context so it can return to it if an exception occurs the statements nested under the try header are run first what happens next depends on whether exceptions are raised while the try block' statements are runningand whether they match those that the try is watching forif an exception occurs while the try block' statements are runningand the exception matches one that the statement namespython jumps back to the try and runs the statements under the first except clause that matches the raised exceptionafter assigning the raised exception object to the variable named after the as keyword in the clause (if presentafter the except block runscontrol then resumes below the entire try statement (unless the except block itself raises another exceptionin which case the process is started anew from this point in the codeif an exception occurs while the try block' statements are runningbut the exception does not match one that the statement namesthe exception is propagated up to the next most recently entered try statement that matches the exceptionif no such matching try statement can be found and the search reaches the top level of the processpython kills the program and prints default error message exception coding details