Question: Q3: Complete the snippet shown in the figure below using the concept of exception in Python such that the snippet can produce the responses for

Q3: Complete the snippet shown in the figure below using the concept of exception in Python such that the snippet can produce the responses for the three scenarios as illustrated in (A), (B), and (C). It is fine if your answer does not show indentation. Snippet: try: x = input('please enter a number: ') y = int(x) except ???: # complete this part to get the effect of the # three scenarios below. Scenario (A) please enter a number: AC ctrl-c is captured Finally.... Done Scenario (B) please enter a number: 4 A number (4) is received Finally.... Done Scenario (C) please enter a number: 4x a non-numeric (4x) was entered Finally.... Done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
