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

1 thought on “What will be the output of the following Python code?”

Leave a Comment