Examveda

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

Answer: Option C


This Question Belongs to Python Program >> Exception Handling In Python

Join The Discussion

Related Questions on Exception Handling in Python