want to return 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. supposed to define a function named is_string_there(text, string) to test the find function. the function should return True if the string is inside the text or False if the string is not inside the text.
<pre>def find(text, substring): if substring == is_string_there: # compare them first return is_string_there else: return # how do i return empty def is_string_there(text, string): print(is_string_there("I love DSAG", "DSAG")) print(is_string_there("I love Python", "DSAG"))
string_there
def is_string_there(text, string): if find(text, string): return True else: return False
find
def find(text, string): # stop condition here # call the function itself here, e.g. find(text[1:], string)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)