if =targetbreak elseindex - return index as this code snippet impliesthe variables created in the for in loop' expression continue to exist after the loop has terminated like all local variablesthey cease to exist at the end of their enclosing scope exception handling ||python indicates errors and exceptional conditions by raising exceptionsalthough some third-party python libraries use more old-fashioned techniquessuch as "errorreturn values catching and raising exceptions |exceptions are caught using try except blockswhose general syntax istrytry_suite except exception_group as variable except_suite except exception_groupn as variablenexcept_suiten elseelse_suite finallyfinally_suite there must be at least one except blockbut both the else and the finally blocks are optional the else block' suite is executed when the try block' suite has finished normally--but it is not executed if an exception occurs if there is finally blockit is always executed at the end each except clause' exception group can be single exception or parenthesized tuple of exceptions for each groupthe as variable part is optionalif usedthe variable contains the exception that occurredand can be accessed in the exception block' suite if an exception occurs in the try block' suiteeach except clause is tried in turn if the exception matches an exception groupthe corresponding suite is executed to match an exception groupthe exception must be of the same type