Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions