Question #217

Author: admin
tags: Python  
def f(num):
    try:
      if (num == 5):
        raise RuntimeError('bad')
      return 1
    finally:
        return 2

result = f(5)
print(result) # ??
What will printed?
1
2
RuntimeError
SyntaxError
If the finally clause executes a break, continue or return statement, exceptions are not re-raised.
If a finally clause includes a return statement, the returned value will be the one from the finally clause’s return statement, not the value from the try clause’s return statement.
Rate the difficulty of the question:
easyhard