Question: ALL IN PYTHON LANGUAGE Write the recursive function containing_word, which takes as its argument a nested list of sentence strings and a target word, returning

ALL IN PYTHON LANGUAGE

ALL IN PYTHON LANGUAGE Write the recursive function containing_word, which takes as

Write the recursive function containing_word, which takes as its argument a nested list of sentence strings and a target word, returning a list of sentences that contain the target word. The function should ignore objects of types other than list or string. Assume that if the function encounters a string, that the string is guaranteed to be a sentence. . Any sentence will be a string of words separated by any number of spaces, with no other characters (i.e. no punctuation-no periods, commas, etc). For this function, uppercase words are considered distinct from lowercase words. o Example: "Excellent" is not considered the same as "excellent" It should ignore objects of types other than list or string. For example, consider the list defined below: sentence_list -['I am Boo', ['I wear Boots', ['Boo is love'], 'Nothing here'1] The call containing_word(sentence_list, 'Boo') should return ['I am Boo', 'Boo is love'] def containing_word (slist: [str or list], target: str) -> [str]

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!