Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is python language I need to create recursive function that checks to see if text2 contains a substring of text1. This is normal function
This is python language
I need to create recursive function that checks to see if text2 contains a substring of text1. This is normal function what I made. no commands such as .contains, .string dlicing, .startswith when you are making the function
def check(text1,text2):
if text1 =="":
return True
if text2 in text1:
return True
else:
return False
def main():
text2=str(raw_input("Enter the text2: "))
text1= str(raw_input("Enter the text1: "))
print(check(text1,text2))
main()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started