CHALLENGE ACTIVITY 10.2.1: Enter the output of multiple exception handlers. 375510.2350218.qx3zqy7 Jump to level 1 1 Typ

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

CHALLENGE ACTIVITY 10.2.1: Enter the output of multiple exception handlers. 375510.2350218.qx3zqy7 Jump to level 1 1 Typ

Post by answerhappygod »

Challenge Activity 10 2 1 Enter The Output Of Multiple Exception Handlers 375510 2350218 Qx3zqy7 Jump To Level 1 1 Typ 1
Challenge Activity 10 2 1 Enter The Output Of Multiple Exception Handlers 375510 2350218 Qx3zqy7 Jump To Level 1 1 Typ 1 (39.76 KiB) Viewed 45 times
CHALLENGE ACTIVITY 10.2.1: Enter the output of multiple exception handlers. 375510.2350218.qx3zqy7 Jump to level 1 1 Type the program's output 2 2 心。」。 a numbers = [2, 4, 5, 81 user_input = input() while user_input != 'end': try: # Possible ValueError divisor = int(user_input) if divisor > 20: # Possible Name Error # compute() is not defined result = compute (result) elif divisor < 0: # Possible IndexError result = numbers [divisor] else: # Possible ZeroDivisionError result = 20 // divisor print (result, end='') except (ValueError, ZeroDivisionError): print('r', end='') except NameError, IndexError): print('s', end='') user_input = input () print ('OK') Input -2 5 5 98 0 0 -6 six end # // truncates to an integer Output 2 3 Check Next Feedback?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply