What will be the output of the following Python code?

try:
    if '1' != 1:
        raise "someError"
    else:
        print("someError has not occurred")
except "someError":
    print ("someError has occurred")

a) someError has occurred
b) someError has not occurred
c) invalid code
d) none of the mentioned

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

Leave a Comment