Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

17 What would be the output of the following program? Please note that the operation x % 10 (i.e., x modulo 10) is always the

image text in transcribedimage text in transcribedimage text in transcribed
17 What would be the output of the following program? Please note that the operation x % 10 (i.e., x modulo 10) is always the same as the rightmost digit of x (e.g., 123 % 10 = 3). out of dictionary = { 9: "DDD" , 10: "DWL", 11: "LLL", 12: "WDD", 13: "WLW" question 19: "DDL " ", 20: "DWW", 21:"LLW", 22: "WDL" ", 23: "WWD" 29: "DDW" , 30: "LDW" 31: "LWD", 32: "WDW", 33: "WWL" 39: "DLL", 40:"LLD", 41: "LWL", 42: "WLD", 43: "WWW" rnd = [2, 2, 1, 1, 1, 2, 2, 1, 0, 0, 0, 1, 2, 1, 0, 2, 2, 0] def examFunction (value) : rnd_pos = 7 output = for iteration in range(3) : word = dictionary . get(value, "DWL") position = rnd [rnd_pos ] output += word [position] rnd_pos = rnd_pos + 1 value = value + 3 return output print (examFunction(20) ) Select one: O DDD O DDW O DDL O DWD O DWW O DWL O DLD O DLW O DLL O WDD O WDW\fon 6 Suppose that x and y are strings. Which of one the following expressions would be equivalent to x. replace(y, "", 1)? red d out of Select one: g question O x[x. find(y) : ]+x[x. find(y)-1: ] O x[ :x. find(y)]+x[x. find(y)+len(y) : ] O x[x. find(y) : ]+x[ : x. find(y)+len(y) ] O x[ :x. find(y)]+x[x. find(y)+1: ] O None of these options

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions