Does 'finally' always execute in Python?
Does 'finally' always execute in Python? Question: For any possible try-finally block in Python, is it guaranteed that the finally block will always be executed? For example, let’s say I return while in an except block: try: 1/0 except ZeroDivisionError: return finally: print(“Does this code run?”) Or maybe I re-raise an Exception: try: 1/0 except …
Total answers: 6