Python for Beginners - Search Engine Project | Sololearn: Learn to code for FREE!


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))

4/13/2021 4:02:55 PM


2 Answers

New Answer


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.


In your last line only write search(text, word)