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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

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 (?) , you can switch to a simple comment.
Switch to a voting comment New
fermins
3 months, 2 weeks 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 1 times
...
emanuelcar990
9 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, 5 months ago
A and D are correct.
upvoted 4 times
...
Dav023
1 year, 7 months ago
A and D are correct.
upvoted 3 times
...
stuartz
1 year, 11 months ago
A and D are correct. B fails, C has no exception to handle
upvoted 3 times
...
Baldridge
1 year, 11 months ago
A D are correct
upvoted 3 times
...
macxsz
2 years ago
Only D is right. A raises another exception after the first ValueError exception
upvoted 2 times
...
MTLE
2 years 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 ...