Page 1 of 1

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

Posted: Sun May 15, 2022 10:22 am
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 46 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?