finally: Guaranteed execution
The finally block always runs, whether try raised an exception or not. Even if try or except contains return, Python still enters finally first, runs its code, and only then returns.
The finally block always runs, whether try raised an exception or not. Even if try or except contains return, Python still enters finally first, runs its code, and only then returns.