Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP-31-03 All Questions

View all questions & answers for the PCAP-31-03 exam

Exam PCAP-31-03 topic 1 question 10 discussion

Actual exam question from Python Institute's PCAP-31-03
Question #: 10
Topic #: 1
[All PCAP-31-03 Questions]

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

  • A. the string what a pity will be seen
  • B. the string it's nice to see you will be seen
  • C. the code will raise an unhandled exception
  • D. the string I feel fine will be seen
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
DKAT2023
4 months, 3 weeks ago
Selected Answer: BD
first D will see , after B will see
upvoted 3 times
...
Dave304409
4 months, 3 weeks ago
Selected Answer: AB
is correct
upvoted 1 times
...
Dave304409
4 months, 4 weeks ago
A, D is correct
upvoted 2 times
Dave304409
4 months, 4 weeks ago
A, B is correct
upvoted 1 times
...
...
DKAT2023
5 months ago
A and D are corrects
upvoted 2 times
...
kstr
5 months, 3 weeks ago
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")
upvoted 3 times
DKAT2023
4 months, 3 weeks ago
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
upvoted 2 times
kstr
4 months, 2 weeks ago
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
upvoted 1 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...