Question: Python question. 1. Write the recursive function containing_word , which takes as its argument a nested list of sentence strings and a target word, returning

Python question.

1. 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.

For example,

sentence_list = ['Hi mc', ['A',['mc'],'c']]

The call containing_word(sentence_list, mc) should return ['Hi mc', 'mc']

def containing_word(slist: [str or list], target: str ) -> [str]:

???

2. Write a recursive function recursive_list_division which takes in a nested list of integers and returns a nested list of integers whose values are all divided by the parameter n.

def recursive_list_division(n: int, nums : list) -> list

???

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!