What is true about the following snippet? (Choose two.)
What is true about the following snippet? (Choose two.)
The given code snippet first executes the `print(
first D will see , after B will see
AD CODE: class E(Exception): def __init__(self, message): self.message = message def __str__(self): return "It's nice to see you" try: print("I feel fine") raise Exception("what a pity") except Exception as e: print(e) else: print("the show must go on")
you write the code error, it should be : raise E("what a pity") instead of raise Exception("what a pity") and except E as e: instead of except Exception as e: , so the corrects are : B and D, not A and D
You are right lass E(Exception): def __init__(self, message): self.message = message def __str__(self): return "It's nice to see you" try: print("I feel fine") raise E("what a pity") except Exception as e: print(e) else: print("the show must go on") Correct is BD
A, D is correct
A, B is correct
A and D are corrects
is correct