PCAP-31-03 Exam QuestionsBrowse all questions from this exam

PCAP-31-03 Exam - Question 10


What is true about the following snippet? (Choose two.)

Show Answer
Correct Answer: BD

The given code snippet first executes the `print(

Discussion

5 comments
Sign in to comment
kstrOptions: AD
Jun 5, 2024

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")

DKAT2023
Jul 9, 2024

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

kstr
Jul 12, 2024

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

DKAT2023Options: BD
Jul 9, 2024

first D will see , after B will see

DKAT2023Options: AD
Jun 28, 2024

A and D are corrects

Dave304409Options: AD
Jul 2, 2024

A, D is correct

Dave304409
Jul 2, 2024

A, B is correct

Dave304409Options: AB
Jul 8, 2024

is correct