Vidyalelo
Python · Q57

Exception Handling in Python

Programming · Python · question 57

Q57

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
Answer
D.
none of the mentioned

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board