Когда я пишу код на Python с обработкой исключений, я могу написать такой код:
try:
some_code_that_can_cause_an_exception()
except:
some_code_to_handle_exceptions()
else:
code_that_needs_to_run_when_there_are_no_exceptions()
Чем это отличается от:
try:
some_code_that_can_cause_an_exception()
except:
some_code_to_handle_exceptions()
code_that_needs_to_run_when_there_are_no_exceptions()
В обоих случаях code_that_needs_to_run_when_there_are_no_exceptions()
будет выполняться при отсутствии исключений. Какая разница?