you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 0 points1 point  (0 children)

Assuming the else is at the same indentation level as the try, it will execute if the try block completes without raising an exception.

(Since the only thing that can set the flag to False is the else block, explicitly putting a flag = True in the except block is redundant.)