A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-66.py
1try:
2raiseValueError
3exceptValueError:
4print("caught")
5else:
6print("else")
7finally:
8print("finally")
Quirks
Answer & explanation
Console output
caught
finally
Why
Raising `ValueError` transfers control to the matching `except` clause, which prints "caught". The `else` clause runs only when the `try` block finishes without an exception, so it is skipped here. The `finally` clause still runs last, giving "caught" then "finally".