Exam PCAP All QuestionsBrowse all questions from this exam
Question 114

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

A.

B.

C.

D.

    Correct Answer:

    D

Discussion
Nenggg

A and D are correct.

emanuelcar990

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

Dav023

A and D are correct.

stuartz

A and D are correct. B fails, C has no exception to handle

Baldridge

A D are correct

MTLE

AD should be right

macxsz

Only D is right. A raises another exception after the first ValueError exception

fermins

try: print(float('1e1')) except (ValueError, NameError): print(float('1a1')) else: print(float('101')) Rises no exception. Both A and D are correct