Question: def check(text1,text2): if text1 == : return True n= text2.find(text1[0]) if n == -1: return False else: return check(text1[1:],text2[n+1: ]) works with match text1 with

def check(text1,text2):

if text1 == "":

return True

n= text2.find(text1[0])

if n == -1:

return False

else:

return check(text1[1:],text2[n+1: ])

works with match text1 with text2 tion and automation return true but problem is that tion yyytionkkk this should return false because we only check last index for each text. no commands such as .contains, .string dlicing, .startswith when you are making the function. any tips will be helpful.

Thats what i want but by checking the index itself individual end of the substring text1 letter n matches in text2 n. It return True.text1= tionn text2 lupon. Its going return true because of on n. If its tion yyytionkkk. this should false because we are starting only from the end of the word

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!