text =input() word =input() def search(text,word): if word in text: return ("word found") else: return ("word not found") prin | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

text =input() word =input() def search(text,word): if word in text: return ("word found") else: return ("word not found") prin

What wrong it showing expected syntax line 5 the the first return statement any assistance

29th Oct 2021, 10:00 AM
Dennis Onoja
3 Answers
+ 8
First of all, you need to change your title to description and vice versa
29th Oct 2021, 10:04 AM
Simba
Simba - avatar
+ 6
Your question is incomplete, so I had to guess. The main problem was your indentation. I surmised the rest of your code to create an output. Simba has made a comment which is valid pertaining to your sequence of inputs Vs your function input sequence. Because the sequences are reversed, it leads the user to incorrect input. Your code: text =input() word =input() def search(text,word): if word in text: return ("word found") else: return ("word not found") print(search(text,word))
29th Oct 2021, 10:09 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
Don't understand you
29th Oct 2021, 10:05 AM
Dennis Onoja