What will be the output of the following Python code? def foo(): try: print(1) finally: print(2) foo() a) 1 2 b) 1 c) 2 d) none of the mentioned
a Explanation: No error occurs in the try block so 1 is printed. Then the finally block is executed and 2 is printed. Reply
a
Explanation: No error occurs in the try block so 1 is printed. Then the finally block is executed and 2 is printed.