Home / Expert Answers / Computer Science / type-the-program-39-s-output-numbers-2-4-5-8-user-input-input-while-user-input-39-end-39-tr-pa669

(Solved): Type the program's output numbers = [2, 4, 5, 8] user_input = input() while user_input != 'end': tr ...



Type the program's output

numbers = [2, 4, 5, 8] user_input = input() while user_input != 'end': try: # Possible ValueError divisor = int(user_input) if divisor > 20: # Possible NameError # compute() is not defined result = compute(result) elif divisor < 0: # Possible IndexError result = numbers[divisor] else: # Possible ZeroDivisionError result = 20 // divisor # // truncates to an integer print(result, end=' ') except (ValueError, ZeroDivisionError): print('r', end=' ') except (NameError, IndexError): print('s', end=' ') user_input = input() print('OK')

Input

-1 10 -10 one 64 0 end

Output



We have an Answer from Expert

View Expert Answer

Expert Answer


The given code is: numbers = [2, 4, 5, 8] user_input = input() while user_input != 'end': try: divisor = int(user_input) if divisor > 20: resul
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe