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
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
You must be logged in to post a comment.
c
Explanation: A new exception class must inherit from a BaseException. There is no such inheritance here.