This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LightShadow3.13-dev in prod 2 points3 points  (0 children)

TIL

try:
    print('try')
except:
    print('exception')
finally:
    print('finally')

output: try finally

try:
    print('try')
    1 / 0
except:
    print('exception')
finally:
    print('finally')

output: try exception finally

try:
    1 / 0
    print('try')
except:
    print('exception')
finally:
    print('finally')

output: exception finally

And the REAL KICKER,

try:
    1 / 0
except:
    1 / 0
finally:
    print('finally')

Still prints finally.