What is displayed when the following program is run?

Loading

Choose the correct option.

What is displayed when the following program is run?
def main():
    try:
        f()
        print(“After the function call”)
    except ZeroDivisionError:
        print(“Divided by zero!”)
    except:
        print(“Exception”)
def f(): 
    print(1 / 0)
main()

A. “After the function call” followed by “Divided by zero!”
B. “After the function call”
C. “Divided by zero!”
D. “Divided by zero!” followed by “Exception”

Leave a Comment