Suppose that statement2 causes an exception in the following try-except block:
try:
statement1
statement2
statement3
except Exception1:
# Handle exception 1
except Exception2:
# Handle exception 2
statement4
Answer the following questions:
■ Will statement3 be executed?
■ If the exception is not caught, will statement4 be executed?
■ If the exception is caught in the except block, will statement4 be executed?
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.