Question: Write a recursive function named find(text,substring) that will return the substring if the substring is inside the text or return an empty string if substring
Write a recursive function named find(text,substring) that will return the substring if the substring is inside the text or return an empty string if substring is not inside the text. Write another function named is_string_there(text, string) to test the find function. The function will return True if the string is inside the text or False if the string is not inside the text.
Not allowed to change any sentences that are not blocked off. Language used: python 3.
In [8]: N 1 def find(text, substring): def is_string_there(text, string): 15 print(is_string_there("I love DSAG", "DSAG")) print(is_string_there("I love python", "DSAG')) True False
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
