Python for Beginners - Search Engine Project | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Python for Beginners - Search Engine Project

Im gettting the correct output for each test case, but there is a second output that says none in each one, im guessing its because of the second argument in the defined function, but i dont know how to fix it, any help would be appreciated. def search(text, word): if word in text: print('Word found') else: print('Word not found') text = input() word = input() print(search(text, word))

13th Apr 2021, 4:02 PM
MrPringle48 - avatar
4 Answers
+ 2
MrPringle48 Don't print function if you have already printed value in that function because function returns None if you don't use return to return anything. So just call function.
13th Apr 2021, 4:04 PM
A͢J - avatar
+ 1
In your last line only write search(text, word)
11th Aug 2021, 1:36 PM
Abdullah Al Abid
Abdullah Al Abid - avatar
- 2
12th Mar 2022, 11:31 AM
David raju Gollapalli