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

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 114 discussion

Actual exam question from Python Institute's PCAP
Question #: 114
Topic #: 1
[All PCAP Questions]

Which of the following snippets will execute without raising any unhandled exceptions? (Choose two.)
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: D

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
fermins
10 months ago
try: print(float('1e1')) except (ValueError, NameError): print(float('1a1')) else: print(float('101')) Rises no exception. Both A and D are correct
upvoted 2 times
...
emanuelcar990
1 year, 3 months ago
try: print(float("1e1")) except (ValueError, NameError): print(float("1a1")) else: print(float("101")) try: print(0/1) except: print(1/1) else: print(2/1) are the correct , because float("1e1") = 10,0 then the else : float("101") = 101.0 the other code = 0 /1 = 1 then else: 2/1 = 2 so A D
upvoted 3 times
...
Nenggg
1 year, 11 months ago
A and D are correct.
upvoted 4 times
...
Dav023
2 years, 2 months ago
A and D are correct.
upvoted 3 times
...
stuartz
2 years, 5 months ago
A and D are correct. B fails, C has no exception to handle
upvoted 3 times
...
Baldridge
2 years, 6 months ago
A D are correct
upvoted 3 times
...
macxsz
2 years, 7 months ago
Only D is right. A raises another exception after the first ValueError exception
upvoted 2 times
...
MTLE
2 years, 7 months ago
AD should be right
upvoted 3 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 ...