Question: python3 In order to do that, you need to write a function englishDictionary (letters, n) that creates a new word by concatenating elements from list

python3

python3 In order to do that, you need to write a function

In order to do that, you need to write a function englishDictionary (letters, n) that creates a new word by concatenating elements from list letters, starting from lettersfij through lettersli+n], but only if lettersl] does not start with either x or Z In this case, new word is emp there are not enough elements because we reach the end of the list we concatenate only as many elements as we have. For example, suppose your list is letters "ma,le", "zo", "sh", "tip""pa"), and n -3. Join letters[0]+letters 1]+letters[2] +letters[3] . Join letters[1] + letters[2] + letters + letter [4] empty" is created because letters[2] starts with a z' Join letters|3] +letters 4]+letters(5). . Join letters 4]+ letters(5]. letters[5]. You do not need to join anything to letters(5] because there are no values after letters[5 Thus, the result is: malezosh, lezoshtip, empty, shtippa, tippa, pa The meaning of the word will also be created by concatenating the same elements, but backwards. "empty" doesn't have a meaning. For example, if you have used lma", "le", zo"1 to create a new word "malezo", then the meaning of it would be 'oz el am' Each new word and its corresponding meaning should be stored as a pair of key and value in the new dictionary which will be returned at the end def englishDictionary (letters, n): Return a letters "ma, "o, tip","pa" >>englishDictionary (letters, 3) 'malezosh' hs oz el am, 'lezoshtip': 'pit >>>words "xoxo "yum*"lol","ypop" >>englishDictionary (words, 2) 'empty'"' yumlolypop': popy lol muy',1olypop' popy lol'.'ypop': 'popy' YOUR CODE HERE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!